Add profile sync policy controls

This commit is contained in:
2026-05-08 03:44:36 -04:00
parent 38a847c27e
commit ada0a82da8
6 changed files with 139 additions and 10 deletions
+16 -1
View File
@@ -1,4 +1,4 @@
use ely_domain::{DownloadPolicy, Profile, ProfileId, ProfileKind, TabId};
use ely_domain::{DownloadPolicy, Profile, ProfileId, ProfileKind, ProfileSyncPolicy, TabId};
use crate::CoreError;
@@ -89,4 +89,19 @@ impl BrowserCore {
let profile_id = self.active_profile_id.clone();
self.set_profile_download_policy(&profile_id, download_policy)
}
pub fn set_profile_sync_policy(
&mut self,
profile_id: &ProfileId,
sync_policy: ProfileSyncPolicy,
) -> Result<(), CoreError> {
let profile = self
.profiles
.iter_mut()
.find(|profile| profile.id() == profile_id)
.ok_or_else(|| CoreError::ProfileNotFound { id: profile_id.clone() })?;
profile.set_sync_policy(sync_policy);
Ok(())
}
}