forked from open-webui/open-webui
first draft
This commit is contained in:
parent
5fd1acbd99
commit
230f787da1
8 changed files with 149 additions and 6 deletions
|
@ -32,3 +32,16 @@ export const documents = writable([
|
|||
|
||||
export const settings = writable({});
|
||||
export const showSettings = writable(false);
|
||||
function createLocalStorageStore(key, startValue) {
|
||||
const storedValue = localStorage.getItem(key);
|
||||
const initialValue = storedValue ? JSON.parse(storedValue) : startValue;
|
||||
|
||||
const store = writable(initialValue);
|
||||
|
||||
store.subscribe((value) => {
|
||||
localStorage.setItem(key, JSON.stringify(value));
|
||||
});
|
||||
|
||||
return store;
|
||||
}
|
||||
export const showWhatsChanged = createLocalStorageStore('showWhatsChanged', true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue