mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
enh: remember note editor preference
This commit is contained in:
parent
b93ee37f9a
commit
784c5b5471
1 changed files with 7 additions and 2 deletions
|
|
@ -79,7 +79,6 @@
|
||||||
|
|
||||||
let system = '';
|
let system = '';
|
||||||
let editorEnabled = false;
|
let editorEnabled = false;
|
||||||
|
|
||||||
let chatInputElement = null;
|
let chatInputElement = null;
|
||||||
|
|
||||||
const DEFAULT_DOCUMENT_EDITOR_PROMPT = `You are an expert document editor.
|
const DEFAULT_DOCUMENT_EDITOR_PROMPT = `You are an expert document editor.
|
||||||
|
|
@ -311,6 +310,8 @@ Based on the user's instruction, update and enhance the existing notes by incorp
|
||||||
selectedModelId = '';
|
selectedModelId = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
editorEnabled = localStorage.getItem('noteEditorEnabled') === 'true';
|
||||||
|
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
|
||||||
await tick();
|
await tick();
|
||||||
|
|
@ -379,7 +380,11 @@ Based on the user's instruction, update and enhance the existing notes by incorp
|
||||||
<div>
|
<div>
|
||||||
<Tooltip content={$i18n.t('Edit')} placement="top">
|
<Tooltip content={$i18n.t('Edit')} placement="top">
|
||||||
<button
|
<button
|
||||||
on:click|preventDefault={() => (editorEnabled = !editorEnabled)}
|
on:click|preventDefault={() => {
|
||||||
|
editorEnabled = !editorEnabled;
|
||||||
|
|
||||||
|
localStorage.setItem('noteEditorEnabled', editorEnabled ? 'true' : 'false');
|
||||||
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="px-2 @xl:px-2.5 py-2 flex gap-1.5 items-center text-sm rounded-full transition-colors duration-300 focus:outline-hidden max-w-full overflow-hidden hover:bg-gray-50 dark:hover:bg-gray-800 {editorEnabled
|
class="px-2 @xl:px-2.5 py-2 flex gap-1.5 items-center text-sm rounded-full transition-colors duration-300 focus:outline-hidden max-w-full overflow-hidden hover:bg-gray-50 dark:hover:bg-gray-800 {editorEnabled
|
||||||
? ' text-sky-500 dark:text-sky-300 bg-sky-50 dark:bg-sky-200/5'
|
? ' text-sky-500 dark:text-sky-300 bg-sky-50 dark:bg-sky-200/5'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue