mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 21:24:05 +02:00
refactor: serach function now async which is way faster
This commit is contained in:
parent
ae878b7203
commit
f435a7b20a
14 changed files with 203 additions and 106 deletions
|
@ -14,17 +14,27 @@ export default defineNuxtPlugin(() => {
|
|||
},
|
||||
|
||||
async searchHistory(query: string): Promise<HistoryItem[]> {
|
||||
return await invoke<HistoryItem[]>("search_history", { query });
|
||||
try {
|
||||
return await invoke<HistoryItem[]>("search_history", { query });
|
||||
} catch (error) {
|
||||
console.error("Error searching history:", error);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
|
||||
async loadHistoryChunk(
|
||||
offset: number,
|
||||
limit: number
|
||||
): Promise<HistoryItem[]> {
|
||||
return await invoke<HistoryItem[]>("load_history_chunk", {
|
||||
offset,
|
||||
limit,
|
||||
});
|
||||
try {
|
||||
return await invoke<HistoryItem[]>("load_history_chunk", {
|
||||
offset,
|
||||
limit,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error loading history chunk:", error);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
|
||||
async deleteHistoryItem(id: string): Promise<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue