mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
fix: add missing require execFile + instant UI clear on mode toggle
This commit is contained in:
parent
3e875e9634
commit
bf7f71f3d7
1 changed files with 5 additions and 1 deletions
|
|
@ -3383,9 +3383,13 @@ class PaperForgeSettingTab extends PluginSettingTab {
|
|||
.onChange(value => {
|
||||
this.plugin.settings.vector_db_mode = value;
|
||||
this.plugin.saveSettings();
|
||||
// Regenerate vector-runtime-state.json for new mode
|
||||
// Clear cache immediately — show "checking..." then refresh in background
|
||||
this._vectorDepsOk = null;
|
||||
this._embedStatusText = null;
|
||||
this.display();
|
||||
const vp = this.app.vault.adapter.basePath;
|
||||
const py = memoryState.getCachedPython(vp, this.plugin.settings);
|
||||
const { execFile } = require('node:child_process');
|
||||
const args = [...py.extraArgs, '-m', 'paperforge', '--vault', vp, 'embed', 'status', '--json'];
|
||||
execFile(py.path, args, { cwd: vp, timeout: 15000, windowsHide: true }, () => {
|
||||
this._vectorDepsOk = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue