Skip to content

Commit

Permalink
easy
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don committed Oct 4, 2023
1 parent 3f51d2e commit c8ed934
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src-tauri/src/service/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub fn get_data_path() -> DataPath {
}
}

pub fn sync_clipboard_history() {
pub async fn sync_clipboard_history() -> Result<(), ()> {
let data_path = get_data_path();

// get local config from app data
Expand Down Expand Up @@ -116,4 +116,6 @@ pub fn sync_clipboard_history() {
serde_json::to_string(&config).unwrap(),
);
}

Ok(())
}
6 changes: 3 additions & 3 deletions src-tauri/src/utils/hotkey/hotkey_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ pub async fn parse_hotkey_event(key: &Key) {
match event {
Ok(HotkeyEvent::WindowDisplayToggle) => toggle_main_window(),
Ok(HotkeyEvent::TypeClipboard) => type_last_clipboard().await,
Ok(HotkeyEvent::SyncClipboardHistory) => sync_clipboard_history(),
Ok(HotkeyEvent::Preferences) => window.emit("open_preferences_window", Some(())).unwrap(),
Ok(HotkeyEvent::About) => window.emit("open_about_window", Some(())).unwrap(),
Ok(HotkeyEvent::SyncClipboardHistory) => sync_clipboard_history().await.unwrap(),
Ok(e @ HotkeyEvent::Preferences) => window.emit("open_window", Some(e.as_str())).unwrap(),
Ok(e @ HotkeyEvent::About) => window.emit("open_window", Some(e.as_str())).unwrap(),
Ok(HotkeyEvent::Exit) => APP.get().unwrap().exit(1),
Ok(
e @ (HotkeyEvent::RecentClipboard
Expand Down

0 comments on commit c8ed934

Please sign in to comment.