remember whether object view was open

This commit is contained in:
marlon-erler
2024-07-11 21:34:21 +02:00
parent 9a312780d1
commit afc0a10b52
4 changed files with 12 additions and 14 deletions
+2 -3
View File
@@ -162,7 +162,7 @@ export const chats = new React.ListState<Chat>();
export const chatIds = React.restoreListState<string>("chat-ids");
export const selectedChat = new React.State<Chat | undefined>(undefined);
export const isShowingChatTools = new React.State(false);
export const isShowingObjects = React.restoreState("showing-objects", false);
export const newChatName = new React.State("");
export const cannotCreateChat = React.createProxyState(
@@ -178,7 +178,6 @@ export function createChat() {
}
export function closeChatView() {
isShowingChatTools.value = false;
selectedChat.value = undefined;
document.getElementById("settings-tab")?.scrollIntoView();
}
@@ -190,7 +189,7 @@ export function selectChat(chat: Chat) {
}
export function toggleChatTools() {
isShowingChatTools.value = !isShowingChatTools.value;
isShowingObjects.value = !isShowingObjects.value;
}
chatIds.value.forEach((id) => chats.add(new Chat(id)));