mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-11 03:59:09 +00:00
fix(engine): broaden media cookie source support
This commit is contained in:
@@ -215,15 +215,13 @@ pub enum ProxyMode {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[ts(export, export_to = "../../src/bindings/")]
|
||||
pub enum MediaCookieSource {
|
||||
None,
|
||||
Safari,
|
||||
Chrome,
|
||||
Firefox,
|
||||
Edge,
|
||||
Brave,
|
||||
pub struct MediaCookieSource(#[ts(type = "string")] pub String);
|
||||
|
||||
impl Default for MediaCookieSource {
|
||||
fn default() -> Self {
|
||||
Self("none".to_string())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, TS)]
|
||||
@@ -275,7 +273,7 @@ pub struct PersistedSettings {
|
||||
pub prevents_sleep_while_downloading: bool,
|
||||
pub media_cookie_source: MediaCookieSource,
|
||||
pub site_logins: Vec<SiteLogin>,
|
||||
/// The HMAC shared secret for the browser extension. It is persisted in the
|
||||
/// HMAC shared secret for the browser extension. It is persisted in the
|
||||
/// settings database so that startup never needs to touch the OS keychain.
|
||||
/// The keychain is still used as defence-in-depth — grant_keychain_access
|
||||
/// writes the token there — but the DB copy is the primary read path,
|
||||
|
||||
@@ -6,7 +6,9 @@ use serde_json::{Map, Value};
|
||||
use std::collections::HashMap;
|
||||
use tauri::{AppHandle, Manager};
|
||||
|
||||
pub fn load_settings<R: tauri::Runtime>(app_handle: &AppHandle<R>) -> Result<PersistedSettings, String> {
|
||||
pub fn load_settings<R: tauri::Runtime>(
|
||||
app_handle: &AppHandle<R>,
|
||||
) -> Result<PersistedSettings, String> {
|
||||
let database = app_handle.state::<crate::db::DbState>();
|
||||
let connection = database.lock()?;
|
||||
let stored = crate::db::load_settings(&connection)?
|
||||
@@ -296,7 +298,7 @@ fn default_settings() -> PersistedSettings {
|
||||
custom_user_agent: String::new(),
|
||||
ask_where_to_save_each_file: false,
|
||||
prevents_sleep_while_downloading: true,
|
||||
media_cookie_source: MediaCookieSource::None,
|
||||
media_cookie_source: MediaCookieSource::default(),
|
||||
site_logins: Vec::new(),
|
||||
extension_pairing_token: String::new(),
|
||||
auto_check_updates: true,
|
||||
|
||||
Reference in New Issue
Block a user