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
This commit is contained in:
Andrew Beal 2026-07-06 20:38:06 +01:00
parent bcc7ce12ed
commit 7b22c26718
2 changed files with 12 additions and 5 deletions

View file

@ -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;

View file

@ -150,8 +150,11 @@ export class SettingsService {
private settingsSnapshot: string;
public constructor(loadedSettings: Partial<IVaultkeeperAISettings>) {
public constructor(loadedSettings: Partial<IVaultkeeperAISettings> | null) {
this.plugin = Resolve<VaultkeeperAIPlugin>(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)