From 0085866268356e36e1a32f8bccd9e33e87dc800e Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Tue, 4 Apr 2023 15:26:09 +0200 Subject: [PATCH] add button to disable ISync --- src-tauri/src/main.rs | 9 ++++++++- src/settings.html | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f6ab803..8a7bbad 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -84,6 +84,13 @@ fn store_token(token: String) { file.write_all(token.as_bytes()).unwrap(); } +#[tauri::command] +fn remove_token() { + let filepath = &(ip_lib::get_ipass_folder()+"token.ipasst"); + std::fs::remove_file(filepath).unwrap(); + //TODO: cleaner solution via IPass api call to unauthorize +} + #[tauri::command] fn get_isync_status() -> bool { let filepath = &(ip_lib::get_ipass_folder()+"token.ipasst"); @@ -117,7 +124,7 @@ fn main() { get_version,create_entry,random_password, get_entry,get_entries,remove_entry, open_authorize,store_token,get_isync_status, - sync_isync]) + sync_isync,remove_token]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/src/settings.html b/src/settings.html index 565a217..5974401 100644 --- a/src/settings.html +++ b/src/settings.html @@ -13,7 +13,7 @@

ISync

Keep your passwords up-to-date on multiple devices

Current status: Checking - Enable ISync +