-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(dataans): implement app autostart; * feat(dataans): format code;
- Loading branch information
1 parent
daf5adc
commit 1f240b9
Showing
7 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// https://github.com/tauri-apps/plugins-workspace/blob/715a0477be8f6f77af0377f4eca2b649554446be/plugins/autostart/api-iife.js | ||
|
||
use serde_wasm_bindgen::{from_value, to_value}; | ||
|
||
use crate::backend::{invoke, EmptyArgs}; | ||
|
||
pub async fn enable() -> bool { | ||
let args = to_value(&EmptyArgs {}).expect("EmptyArgs serialization to JsValue should not fail."); | ||
invoke("plugin:autostart|enable", args).await; | ||
|
||
is_enabled().await | ||
} | ||
|
||
pub async fn disable() -> bool { | ||
let args = to_value(&EmptyArgs {}).expect("EmptyArgs serialization to JsValue should not fail."); | ||
invoke("plugin:autostart|disable", args).await; | ||
|
||
is_enabled().await | ||
} | ||
|
||
pub async fn is_enabled() -> bool { | ||
let args = to_value(&EmptyArgs {}).expect("EmptyArgs serialization to JsValue should not fail."); | ||
let is_enabled = invoke("plugin:autostart|is_enabled", args).await; | ||
trace!("Is autostart enabled: {:?}.", is_enabled); | ||
|
||
from_value(is_enabled).expect("bool deserialization from JsValue should not fail.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters