Skip to content

Commit

Permalink
Use different flags for "sync in bg" and "first successful sync" dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
crsib committed Apr 11, 2024
1 parent e2c9048 commit 747111a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions modules/mod-cloud-audiocom/CloudProjectFileIOExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand All @@ -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()]
{
Expand All @@ -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()));
Expand Down

0 comments on commit 747111a

Please sign in to comment.