diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index d9ed6f63..471e1e8f 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1304,6 +1304,7 @@ pub fn run() { ), color: Some(Color::Danger), icon: None, + timeout: None, }, ); }; diff --git a/src-tauri/src/plugin_events.rs b/src-tauri/src/plugin_events.rs index 11e5ab75..884d7037 100644 --- a/src-tauri/src/plugin_events.rs +++ b/src-tauri/src/plugin_events.rs @@ -134,6 +134,7 @@ pub(crate) async fn handle_plugin_event( resp.error ), color: Some(Color::Danger), + timeout: None, ..Default::default() }), None, diff --git a/src-tauri/src/uri_scheme.rs b/src-tauri/src/uri_scheme.rs index f9ee6c41..2be03d37 100644 --- a/src-tauri/src/uri_scheme.rs +++ b/src-tauri/src/uri_scheme.rs @@ -47,6 +47,7 @@ pub(crate) async fn handle_deep_link( message: format!("Installed {name}@{}", pv.version), color: Some(Color::Success), icon: None, + timeout: Some(5000), }, )?; } @@ -90,6 +91,7 @@ pub(crate) async fn handle_deep_link( message: "Failed to import data".to_string(), color: Some(Color::Danger), icon: None, + timeout: None, }, )?; return Ok(()); @@ -103,6 +105,7 @@ pub(crate) async fn handle_deep_link( message: format!("Imported data for {} workspaces", results.workspaces.len()), color: Some(Color::Success), icon: None, + timeout: Some(5000), }, )?; } diff --git a/src-tauri/src/window.rs b/src-tauri/src/window.rs index 3cd88054..4048c02d 100644 --- a/src-tauri/src/window.rs +++ b/src-tauri/src/window.rs @@ -56,8 +56,9 @@ pub(crate) fn create_window( #[cfg(not(target_os = "macos"))] { use std::fs; - let dir = handle.path().app_data_dir()?.join("window-sessions").join(key); - fs::create_dir_all(dir.clone())?; + let safe_key = format!("{:x}", md5::compute(key.as_bytes())); + let dir = handle.path().app_data_dir()?.join("window-sessions").join(safe_key); + fs::create_dir_all(&dir)?; win_builder = win_builder.data_directory(dir); } diff --git a/src-tauri/yaak-git/bindings/gen_models.ts b/src-tauri/yaak-git/bindings/gen_models.ts index 1110f887..c78b6a60 100644 --- a/src-tauri/yaak-git/bindings/gen_models.ts +++ b/src-tauri/yaak-git/bindings/gen_models.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, variables: Array, color: string | null, parentModel: string, parentId: string | null, }; +export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, parentModel: string, parentId: string | null, variables: Array, color: string | null, }; export type EnvironmentVariable = { enabled?: boolean, name: string, value: string, id?: string, }; diff --git a/src-tauri/yaak-models/bindings/gen_models.ts b/src-tauri/yaak-models/bindings/gen_models.ts index 1690ca65..51f78ff8 100644 --- a/src-tauri/yaak-models/bindings/gen_models.ts +++ b/src-tauri/yaak-models/bindings/gen_models.ts @@ -14,7 +14,7 @@ export type EditorKeymap = "default" | "vim" | "vscode" | "emacs"; export type EncryptedKey = { encryptedKey: string, }; -export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, variables: Array, color: string | null, parentModel: string, parentId: string | null, }; +export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, parentModel: string, parentId: string | null, variables: Array, color: string | null, }; export type EnvironmentVariable = { enabled?: boolean, name: string, value: string, id?: string, }; diff --git a/src-tauri/yaak-plugins/bindings/gen_events.ts b/src-tauri/yaak-plugins/bindings/gen_events.ts index 36d27536..173f5cbe 100644 --- a/src-tauri/yaak-plugins/bindings/gen_events.ts +++ b/src-tauri/yaak-plugins/bindings/gen_events.ts @@ -437,7 +437,7 @@ export type SetKeyValueRequest = { key: string, value: string, }; export type SetKeyValueResponse = {}; -export type ShowToastRequest = { message: string, color?: Color, icon?: Icon, }; +export type ShowToastRequest = { message: string, color?: Color, icon?: Icon, timeout?: number, }; export type TemplateFunction = { name: string, description?: string, /** diff --git a/src-tauri/yaak-plugins/bindings/gen_models.ts b/src-tauri/yaak-plugins/bindings/gen_models.ts index 1136b85a..b984c7eb 100644 --- a/src-tauri/yaak-plugins/bindings/gen_models.ts +++ b/src-tauri/yaak-plugins/bindings/gen_models.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, variables: Array, color: string | null, parentModel: string, parentId: string | null, }; +export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, parentModel: string, parentId: string | null, variables: Array, color: string | null, }; export type EnvironmentVariable = { enabled?: boolean, name: string, value: string, id?: string, }; diff --git a/src-tauri/yaak-plugins/src/events.rs b/src-tauri/yaak-plugins/src/events.rs index 830bdaa6..3840d0f8 100644 --- a/src-tauri/yaak-plugins/src/events.rs +++ b/src-tauri/yaak-plugins/src/events.rs @@ -494,6 +494,9 @@ pub struct ShowToastRequest { #[ts(optional)] pub icon: Option, + + #[ts(optional)] + pub timeout: Option, } #[derive(Debug, Clone, Default, Serialize, Deserialize, TS)] diff --git a/src-tauri/yaak-sync/bindings/gen_models.ts b/src-tauri/yaak-sync/bindings/gen_models.ts index cf43f482..c8e6fc16 100644 --- a/src-tauri/yaak-sync/bindings/gen_models.ts +++ b/src-tauri/yaak-sync/bindings/gen_models.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, variables: Array, color: string | null, parentModel: string, parentId: string | null, }; +export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, parentModel: string, parentId: string | null, variables: Array, color: string | null, }; export type EnvironmentVariable = { enabled?: boolean, name: string, value: string, id?: string, };