1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Modules UI - Fixed activation view not subscribing sometimes

Core - Don't attempt to catch a timeout during module override, only pain down that route
This commit is contained in:
SpoinkyNL 2020-08-26 22:16:30 +02:00
parent 8d756128e4
commit d62d389d9f
2 changed files with 6 additions and 10 deletions

View File

@ -44,12 +44,11 @@ namespace Artemis.Core.Services
public async Task SetActiveModuleOverride(Module overrideModule)
{
await ActiveModuleSemaphore.WaitAsync();
if (ActiveModuleOverride == overrideModule)
return;
if (!await ActiveModuleSemaphore.WaitAsync(TimeSpan.FromSeconds(10)))
throw new ArtemisCoreException("Timed out while acquiring active module lock");
try
{
ActiveModuleOverride = overrideModule;
@ -92,8 +91,7 @@ namespace Artemis.Core.Services
if (ActiveModuleOverride != null)
return;
if (!await ActiveModuleSemaphore.WaitAsync(TimeSpan.FromSeconds(10)))
throw new ArtemisCoreException("Timed out while acquiring active module lock");
await ActiveModuleSemaphore.WaitAsync();
try
{

View File

@ -24,13 +24,11 @@ namespace Artemis.UI.Screens.Module.Tabs
public Core.Plugins.Modules.Module Module { get; }
public string ActivationType { get; set; }
protected override void OnActivate()
{
if (!Items.Any())
Items.AddRange(Module.ActivationRequirements.Select(_moduleVmFactory.CreateActivationRequirementViewModel));
Items.Clear();
Items.AddRange(Module.ActivationRequirements.Select(_moduleVmFactory.CreateActivationRequirementViewModel));
}
}
}