mirror of
https://github.com/lossless-group/perplexed-plugin.git
synced 2026-07-22 06:49:50 +00:00
fix(core): fix plugin core typescript
On branch fix/lmstudio Changes to be committed: modified: src/core/PerplexedPluginCore.ts
This commit is contained in:
parent
a6417ec351
commit
ef9172c8dd
1 changed files with 11 additions and 8 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue