mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-27 19:50:15 +03:00
clean results on query update
This commit is contained in:
parent
fa06ec611d
commit
db9eccc5d5
@ -1,17 +1,17 @@
|
|||||||
import { invoke } from '@tauri-apps/api';
|
import { invoke } from '@tauri-apps/api';
|
||||||
|
|
||||||
export type SearchResult = {
|
export type SearchResult = {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
filePath: string;
|
filePath: string;
|
||||||
// index of the delta in the session.
|
// index of the delta in the session.
|
||||||
index: number;
|
index: number;
|
||||||
highlighted: string[]; // contains the highlighted text
|
highlighted: string[]; // contains the highlighted text
|
||||||
};
|
};
|
||||||
|
|
||||||
export const search = (params: {
|
export const search = (params: {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
query: string;
|
query: string;
|
||||||
limit?: number;
|
limit?: number;
|
||||||
offset?: number;
|
offset?: number;
|
||||||
}) => invoke<SearchResult[]>('search', params);
|
}) => invoke<SearchResult[]>('search', params);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
$: {
|
$: {
|
||||||
stopProcessing = true;
|
stopProcessing = true;
|
||||||
|
processedResults = [];
|
||||||
if ($searchTerm) {
|
if ($searchTerm) {
|
||||||
fetchResults($project?.id ?? '', $searchTerm);
|
fetchResults($project?.id ?? '', $searchTerm);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user