mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-07-07 13:37:55 +02:00
feat: windows support
This commit is contained in:
@@ -24,6 +24,18 @@ impl SyncEngine {
|
||||
}
|
||||
|
||||
pub async fn create_from_settings(app_handle: &tauri::AppHandle) -> Result<Self, String> {
|
||||
// Cloud auth takes priority
|
||||
if crate::cloud_auth::CLOUD_AUTH.is_logged_in().await {
|
||||
let url = crate::cloud_auth::CLOUD_SYNC_URL.to_string();
|
||||
let token = crate::cloud_auth::CLOUD_AUTH
|
||||
.get_or_refresh_sync_token()
|
||||
.await
|
||||
.map_err(|e| format!("Failed to get cloud sync token: {e}"))?
|
||||
.ok_or_else(|| "Cloud sync token not available".to_string())?;
|
||||
return Ok(Self::new(url, token));
|
||||
}
|
||||
|
||||
// Fall back to self-hosted settings
|
||||
let manager = SettingsManager::instance();
|
||||
let settings = manager
|
||||
.load_settings()
|
||||
|
||||
Reference in New Issue
Block a user