add button to disable ISync

This commit is contained in:
Mystikfluu
2023-04-04 15:26:09 +02:00
parent c09e478ffd
commit 0085866268
2 changed files with 13 additions and 2 deletions
+8 -1
View File
@@ -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");
}