mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 21:24:05 +02:00
feat: enhance ActionsMenu functionality with improved keyboard context management and dynamic history updates
This commit is contained in:
parent
be1718d9a5
commit
a79268d0f7
2 changed files with 31 additions and 16 deletions
|
@ -5,6 +5,7 @@ use rand::distr::Alphanumeric;
|
|||
use sqlx::{ Row, SqlitePool };
|
||||
use std::fs;
|
||||
use tauri_plugin_aptabase::EventTracker;
|
||||
use tauri::Emitter;
|
||||
|
||||
pub async fn initialize_history(pool: &SqlitePool) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let id: String = rng()
|
||||
|
@ -106,6 +107,8 @@ pub async fn add_history_item(
|
|||
"content_type": item.content_type.to_string()
|
||||
}))
|
||||
);
|
||||
|
||||
let _ = app_handle.emit("clipboard-content-updated", ());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -195,6 +198,7 @@ pub async fn delete_history_item(
|
|||
.map_err(|e| e.to_string())?;
|
||||
|
||||
let _ = app_handle.track_event("history_item_deleted", None);
|
||||
let _ = app_handle.emit("clipboard-content-updated", ());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -210,6 +214,7 @@ pub async fn clear_history(
|
|||
.map_err(|e| e.to_string())?;
|
||||
|
||||
let _ = app_handle.track_event("history_cleared", None);
|
||||
let _ = app_handle.emit("clipboard-content-updated", ());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue