Unregistration condition.

This commit is contained in:
Burak Kaan Köse
2024-08-09 02:02:11 +02:00
parent 25a8a52573
commit 99592a52be

View File

@@ -17,7 +17,7 @@ namespace Wino.Core.UWP.Services
public void UnregisterAllBackgroundTask()
{
if (_configurationService.Get<bool>(IsBackgroundTasksUnregisteredKey, false))
if (!_configurationService.Get(IsBackgroundTasksUnregisteredKey, false))
{
foreach (var task in BackgroundTaskRegistration.AllTasks)
{
@@ -25,6 +25,7 @@ namespace Wino.Core.UWP.Services
}
Log.Information("Unregistered all background tasks.");
_configurationService.Set(IsBackgroundTasksUnregisteredKey, true);
}
}
}