Fixed a bug where the searchQuery value was not kept between contexts
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
import ResultItemInFile from './ResultItemInFile.svelte'
|
import ResultItemInFile from './ResultItemInFile.svelte'
|
||||||
import { Query } from 'src/query'
|
import { Query } from 'src/query'
|
||||||
import { openNote } from 'src/notes'
|
import { openNote } from 'src/notes'
|
||||||
|
import {saveSearchHistory} from "../search-history";
|
||||||
|
|
||||||
export let modal: OmnisearchInFileModal
|
export let modal: OmnisearchInFileModal
|
||||||
export let parent: OmnisearchVaultModal | null = null
|
export let parent: OmnisearchVaultModal | null = null
|
||||||
@@ -111,6 +112,7 @@
|
|||||||
evt?: MouseEvent | KeyboardEvent
|
evt?: MouseEvent | KeyboardEvent
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (note) {
|
if (note) {
|
||||||
|
await saveSearchHistory()
|
||||||
modal.close()
|
modal.close()
|
||||||
if (parent) parent.close()
|
if (parent) parent.close()
|
||||||
|
|
||||||
|
|||||||
@@ -87,8 +87,12 @@
|
|||||||
modal.close()
|
modal.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
function openSearchResult(note: ResultNote, newPane = false) {
|
function saveCurrentQuery() {
|
||||||
searchHistory.unshift(searchQuery)
|
searchHistory.unshift(searchQuery)
|
||||||
|
}
|
||||||
|
|
||||||
|
function openSearchResult(note: ResultNote, newPane = false) {
|
||||||
|
saveCurrentQuery()
|
||||||
saveSearchHistory()
|
saveSearchHistory()
|
||||||
openNote(note, newPane)
|
openNote(note, newPane)
|
||||||
}
|
}
|
||||||
@@ -139,6 +143,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function switchToInFileModal(): void {
|
function switchToInFileModal(): void {
|
||||||
|
saveCurrentQuery()
|
||||||
modal.close()
|
modal.close()
|
||||||
if (selectedNote) {
|
if (selectedNote) {
|
||||||
// Open in-file modal for selected search result
|
// Open in-file modal for selected search result
|
||||||
|
|||||||
Reference in New Issue
Block a user