From 747111ad11fad5d39219247ca5cc60d9f7c89943 Mon Sep 17 00:00:00 2001 From: Dmitry Vedenko Date: Thu, 11 Apr 2024 14:44:12 +0300 Subject: [PATCH] Use different flags for "sync in bg" and "first successful sync" dialogs --- .../CloudProjectFileIOExtensions.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/mod-cloud-audiocom/CloudProjectFileIOExtensions.cpp b/modules/mod-cloud-audiocom/CloudProjectFileIOExtensions.cpp index feff16270a92..bf58bdbc2ba0 100644 --- a/modules/mod-cloud-audiocom/CloudProjectFileIOExtensions.cpp +++ b/modules/mod-cloud-audiocom/CloudProjectFileIOExtensions.cpp @@ -218,10 +218,13 @@ class IOExtension final : public ProjectFileIOExtension const int savesCount = projectCloudExtension.GetSavesCount(); - if (savesCount > 1) - return; + if (savesCount < 2) + { + SyncInBackroundDialog { &project }.ShowDialog(); + } - SyncInBackroundDialog { &project }.ShowDialog(); + if (projectCloudExtension.IsFirstSyncDialogShown()) + return; ShowDialogOn( [weakProject = project.weak_from_this()] @@ -231,7 +234,8 @@ class IOExtension final : public ProjectFileIOExtension if (!project) return true; - return !ProjectCloudExtension::Get(*project).IsSyncing(); + return ProjectCloudExtension::Get(*project) + .GetCurrentSyncStatus() == ProjectSyncStatus::Synced; }, [weakProject = project.weak_from_this()] { @@ -240,14 +244,11 @@ class IOExtension final : public ProjectFileIOExtension if (!project) return; - if ( - ProjectCloudExtension::Get(*project).GetCurrentSyncStatus() != - ProjectSyncStatus::Synced) - return; - const auto result = SyncSucceededDialog { project.get() }.ShowDialog(); + ProjectCloudExtension::Get(*project).SetFirstSyncDialogShown(true); + if (result == SyncSucceededDialog::ViewOnlineIdentifier()) BasicUI::OpenInDefaultBrowser(audacity::ToWXString( ProjectCloudExtension::Get(*project).GetCloudProjectPage()));