mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-11 03:38:02 +00:00
refac
This commit is contained in:
parent
64ff15a536
commit
bee13f72ad
2 changed files with 23 additions and 2 deletions
|
|
@ -704,6 +704,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Persist controls panel state for desktop only
|
||||
if (!$mobile) {
|
||||
localStorage.setItem('showControls', JSON.stringify(value));
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
showCallOverlay.set(false);
|
||||
showOverview.set(false);
|
||||
|
|
@ -712,6 +717,18 @@
|
|||
}
|
||||
});
|
||||
|
||||
// Restore controls panel state on desktop
|
||||
if (!$mobile) {
|
||||
try {
|
||||
const savedShowControls = localStorage.getItem('showControls');
|
||||
if (savedShowControls !== null && JSON.parse(savedShowControls)) {
|
||||
showControls.set(true);
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
selectedFolderSubscribe = selectedFolder.subscribe(async (folder) => {
|
||||
if (
|
||||
folder?.data?.model_ids &&
|
||||
|
|
@ -1089,7 +1106,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
await showControls.set(false);
|
||||
if ($mobile) {
|
||||
await showControls.set(false);
|
||||
}
|
||||
await showCallOverlay.set(false);
|
||||
await showOverview.set(false);
|
||||
await showArtifacts.set(false);
|
||||
|
|
|
|||
|
|
@ -169,7 +169,9 @@
|
|||
});
|
||||
|
||||
onDestroy(() => {
|
||||
showControls.set(false);
|
||||
if (!largeScreen) {
|
||||
showControls.set(false);
|
||||
}
|
||||
mediaQuery.removeEventListener('change', handleMediaQuery);
|
||||
document.removeEventListener('mousedown', onMouseDown);
|
||||
document.removeEventListener('mouseup', onMouseUp);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue