fix: lots of missing pieces for python macro handling
This commit is contained in:
@@ -14,6 +14,8 @@ import {
|
||||
import { createDeferredEventGate } from './navigation/deferredEventGate';
|
||||
import { createAndFocusPost } from './navigation/postCreation';
|
||||
import { ensureRendererPicoThemeStylesheet, getRendererPicoTheme } from './utils/picoTheme';
|
||||
import { addWindowEventListener, BDS_EVENT_SCRIPTS_CHANGED } from './utils/windowEvents';
|
||||
import { refreshPythonMacroSlugs } from './macros';
|
||||
import { useI18n } from './i18n';
|
||||
import './App.css';
|
||||
|
||||
@@ -104,6 +106,9 @@ const App: React.FC = () => {
|
||||
if (tasks) {
|
||||
setTasks(tasks as TaskProgress[]);
|
||||
}
|
||||
|
||||
// Load known Python macro slugs for editor detection
|
||||
await refreshPythonMacroSlugs();
|
||||
} catch (error) {
|
||||
console.error('Failed to load initial data:', error);
|
||||
} finally {
|
||||
@@ -557,6 +562,13 @@ const App: React.FC = () => {
|
||||
}) || (() => {})
|
||||
);
|
||||
|
||||
// Refresh Python macro slugs when scripts change
|
||||
unsubscribers.push(
|
||||
addWindowEventListener(BDS_EVENT_SCRIPTS_CHANGED, () => {
|
||||
void refreshPythonMacroSlugs();
|
||||
})
|
||||
);
|
||||
|
||||
void window.electronAPI?.app.notifyRendererReady?.().catch((error) => {
|
||||
console.error('Failed to notify renderer readiness:', error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user