From 7b22c267181698f52e679e3eb42dab63f71163ca Mon Sep 17 00:00:00 2001 From: Andrew Beal Date: Mon, 6 Jul 2026 20:38:06 +0100 Subject: [PATCH] fix: handle null settings for new users and reorganize CSS styles - Add null check for loadedSettings in SettingsService constructor - Reorder CSS rules in ChatInput to group related mobile styles together --- Components/ChatInput.svelte | 12 ++++++++---- Services/SettingsService.ts | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Components/ChatInput.svelte b/Components/ChatInput.svelte index ecaee87..2f3847f 100644 --- a/Components/ChatInput.svelte +++ b/Components/ChatInput.svelte @@ -838,10 +838,6 @@ max-height: 2rem; } - .input-button-highlight { - box-shadow: 0px 0px 2px 1px var(--color-accent); - } - #free-edit-button { grid-row: 9; grid-column: 10; @@ -851,6 +847,14 @@ transition-duration: 0.5s; } + :global(.is-mobile) #free-edit-button { + max-height: 2rem; + } + + .input-button-highlight { + box-shadow: 0px 0px 2px 1px var(--color-accent); + } + #submit-button { grid-row: 9; grid-column: 12; diff --git a/Services/SettingsService.ts b/Services/SettingsService.ts index 325340b..e68e4b5 100644 --- a/Services/SettingsService.ts +++ b/Services/SettingsService.ts @@ -150,8 +150,11 @@ export class SettingsService { private settingsSnapshot: string; - public constructor(loadedSettings: Partial) { + public constructor(loadedSettings: Partial | null) { this.plugin = Resolve(Services.VaultkeeperAIPlugin); + + loadedSettings ??= {}; // New users won't have any settings yet + this.settings = Object.assign({}, DEFAULT_SETTINGS, loadedSettings, { apiKeys: Object.assign({}, DEFAULT_SETTINGS.apiKeys, loadedSettings.apiKeys), localModels: Object.assign({}, DEFAULT_SETTINGS.localModels, loadedSettings.localModels)