diff --git a/main.ts b/main.ts index 6940663..01058d7 100644 --- a/main.ts +++ b/main.ts @@ -61,19 +61,10 @@ export default class LLMAgentPlugin extends Plugin { const response = await fetch(`${this.settings.apiBaseUrl}/settings/sync`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - systemPrompt: this.settings.systemPrompt, - interval: this.settings.voiceInterval, - context_limit: this.settings.voiceContextLimit, - marker_start: this.settings.markerStart, - marker_stop: this.settings.markerStop, - // Передаем также пути к файлам промптов, если нужно - prompt_regular: this.settings.promptRegularPath, - prompt_commands: this.settings.promptCommandsPath - }) + body: JSON.stringify(this.settings) }); if (response.ok) { - console.log("LLM Agent: Voice settings synced with backend."); + console.log("LLM Agent: Settings synced with backend."); } } catch (e) { console.error("LLM Agent: Failed to sync settings", e); diff --git a/src/components/VoicePanel.ts b/src/components/VoicePanel.ts index 61c79d3..b9b2154 100644 --- a/src/components/VoicePanel.ts +++ b/src/components/VoicePanel.ts @@ -64,6 +64,10 @@ export class VoicePanel { updateContent(data: any) { const body = this.container.querySelector('#v-body'); if (!body) return; + if (data.obsidian_settings_fetched == false) // если это не сделать, то на беке останутся пустые настройки, если обсидиан запущен раньше бека + { + this.plugin.syncVoiceSettings(); + } if (this.activeTab === 'trans') body.textContent = data.transcription; if (this.activeTab === 'res1') body.textContent = data.response1; if (this.activeTab === 'res2') body.innerHTML = data.response2.join('
---
');