diff --git a/src/core/PerplexedPluginCore.ts b/src/core/PerplexedPluginCore.ts index 9c11e1e..75136f4 100644 --- a/src/core/PerplexedPluginCore.ts +++ b/src/core/PerplexedPluginCore.ts @@ -26,7 +26,8 @@ export class PerplexedPluginCore extends Plugin { } // Load LM Studio settings - const loadedLMStudioSettings = await this.loadData('lmstudio-settings'); + const loadedData = await this.loadData(); + const loadedLMStudioSettings = loadedData?.['lmstudio-settings']; if (loadedLMStudioSettings) { this.lmStudioSettings = { ...DEFAULT_LMSTUDIO_SETTINGS, @@ -44,19 +45,17 @@ export class PerplexedPluginCore extends Plugin { await this.saveData(this.settings); // Save LM Studio settings with a separate key - await this.saveData(this.lmStudioSettings, 'lmstudio-settings'); + const currentData = await this.loadData() || {}; + await this.saveData({ + ...currentData, + 'lmstudio-settings': this.lmStudioSettings + }); } catch (error) { console.error('Error saving settings:', error); } } protected registerCommands(): void { - // Base implementation - can be overridden by child classes - } - - protected setupUI(): void { - // Base implementation - can be overridden by child classes - } private registerCommands() { // Register your commands here // Example: this.addCommand({ @@ -67,4 +66,8 @@ export class PerplexedPluginCore extends Plugin { } }); } + + protected setupUI(): void { + // Base implementation - can be overridden by child classes + } }