fix(web): reset search history after logout (#17534)
fix(web): reset search suggestions after logout
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
import { persisted } from 'svelte-persisted-store';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const savedSearchTerms = persisted<string[]>('search-terms', [], {});
|
||||
export const isSearchEnabled = writable<boolean>(false);
|
||||
export const preventRaceConditionSearchBar = writable<boolean>(false);
|
||||
@@ -0,0 +1,13 @@
|
||||
class SearchStore {
|
||||
savedSearchTerms = $state<string[]>([]);
|
||||
isSearchEnabled = $state(false);
|
||||
preventRaceConditionSearchBar = $state(false);
|
||||
|
||||
clearCache() {
|
||||
this.savedSearchTerms = [];
|
||||
this.isSearchEnabled = false;
|
||||
this.preventRaceConditionSearchBar = false;
|
||||
}
|
||||
}
|
||||
|
||||
export const searchStore = new SearchStore();
|
||||
Reference in New Issue
Block a user