Lock private profile sync state

This commit is contained in:
2026-05-08 20:19:09 -04:00
parent a299815e51
commit 8e450496e0
5 changed files with 58 additions and 4 deletions
+3
View File
@@ -36,6 +36,9 @@ pub enum CoreError {
#[error("profile not found: {id}")]
ProfileNotFound { id: ProfileId },
#[error("private profile keeps sync paused: {id}")]
PrivateProfileSyncLocked { id: ProfileId },
#[error("download not found: {id}")]
DownloadNotFound { id: DownloadId },
@@ -100,6 +100,9 @@ impl BrowserCore {
.iter_mut()
.find(|profile| profile.id() == profile_id)
.ok_or_else(|| CoreError::ProfileNotFound { id: profile_id.clone() })?;
if sync_policy == ProfileSyncPolicy::Enabled && !profile.allows_sync() {
return Err(CoreError::PrivateProfileSyncLocked { id: profile_id.clone() });
}
profile.set_sync_policy(sync_policy);
Ok(())