From 53e6050757464717b06662c3472229cc962f6e92 Mon Sep 17 00:00:00 2001 From: Luka Grabarevic Date: Mon, 9 Jul 2018 13:19:35 +0200 Subject: [PATCH] Bugfix loading issues (#27) * Fixed the need to configure selected build definitions when grouping by pull request * Fixed possible polling dead lock issues --- BuildsAppReborn.Access/BuildMonitor.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BuildsAppReborn.Access/BuildMonitor.cs b/BuildsAppReborn.Access/BuildMonitor.cs index 2f3608b..2559107 100644 --- a/BuildsAppReborn.Access/BuildMonitor.cs +++ b/BuildsAppReborn.Access/BuildMonitor.cs @@ -21,17 +21,17 @@ internal sealed class BuildMonitor : IBuildMonitorAdvanced [ImportingConstructor] public BuildMonitor(LazyContainer buildProviders, LazyContainer notificationProviders, - IEqualityComparer buildDefinitionEqualityComparer) + IEqualityComparer buildDefinitionEqualityComparer, + GeneralSettings generalSettings) { this.buildProviders = buildProviders; this.buildDefinitionEqualityComparer = buildDefinitionEqualityComparer; + this.generalSettings = generalSettings; this.notificationProvider = notificationProviders.GetSupportedNotificationProvider(); -#pragma warning disable 4014 - this.timer.Elapsed += (sender, args) => BeginPollingBuildsAsync(); -#pragma warning restore 4014 + this.timer.Elapsed += (sender, args) => BeginPollingBuildsAsync().GetAwaiter().GetResult(); } - public Boolean IsConfigured => this.providerSettingsGroup.Any() && this.providerSettingsGroup.SelectMany(a => a.Value).SelectMany(a => a.SelectedBuildDefinitions).Any(); + public Boolean IsConfigured => this.providerSettingsGroup.Any() && (this.generalSettings.ViewStyle == BuildViewStyle.GroupByPullRequest || this.providerSettingsGroup.SelectMany(a => a.Value).SelectMany(a => a.SelectedBuildDefinitions).Any()); public async Task BeginPollingBuildsAsync() {