clean results on query update

This commit is contained in:
Nikita Galaiko 2023-03-17 14:43:21 +01:00
parent fa06ec611d
commit db9eccc5d5
2 changed files with 11 additions and 10 deletions

View File

@ -1,17 +1,17 @@
import { invoke } from '@tauri-apps/api';
export type SearchResult = {
projectId: string;
sessionId: string;
filePath: string;
// index of the delta in the session.
index: number;
highlighted: string[]; // contains the highlighted text
projectId: string;
sessionId: string;
filePath: string;
// index of the delta in the session.
index: number;
highlighted: string[]; // contains the highlighted text
};
export const search = (params: {
projectId: string;
query: string;
limit?: number;
offset?: number;
projectId: string;
query: string;
limit?: number;
offset?: number;
}) => invoke<SearchResult[]>('search', params);

View File

@ -21,6 +21,7 @@
$: {
stopProcessing = true;
processedResults = [];
if ($searchTerm) {
fetchResults($project?.id ?? '', $searchTerm);
}