Workshop - Auto-updating WIP

This commit is contained in:
Robert committed 2024-07-14 22:14:17 +02:00
1 parent 99d11e1921
commit 3b2d799bfc
18 files changed
+379 -108

No files matched your search

@@ -101,14 +101,27 @@ public partial class EntryReleaseInfoViewModel : ActivatableViewModelBase
return;
}
// If not the latest version, warn and offer to disable auto-updates
bool disableAutoUpdates = false;
if (Release.Id != Release.Entry.LatestReleaseId)
{
disableAutoUpdates = await _windowService.ShowConfirmContentDialog(
"You are installing an older version of this entry",
"Would you like to disable auto-updates for this entry?",
"Yes",
"No"
);
}
_cts = new CancellationTokenSource();
InstallProgress = 0;
InstallationInProgress = true;
try
{
EntryInstallResult result = await _workshopService.InstallEntry(Release.Entry, Release, _progress, _cts.Token);
if (result.IsSuccess)
if (result.IsSuccess && result.Entry != null)
{
_workshopService.SetAutoUpdate(result.Entry, !disableAutoUpdates);
_notificationService.CreateNotification().WithTitle("Installation succeeded").WithSeverity(NotificationSeverity.Success).Show();
InstallationInProgress = false;
await Manage();
@@ -156,7 +169,7 @@ public partial class EntryReleaseInfoViewModel : ActivatableViewModelBase
await UninstallPluginPrerequisites(installedEntry);
await _workshopService.UninstallEntry(installedEntry, CancellationToken.None);
_notificationService.CreateNotification().WithTitle("Entry uninstalled").WithSeverity(NotificationSeverity.Success).Show();
}
finally