fix: title update for import definitions
This commit is contained in:
@@ -842,7 +842,7 @@ export function registerIpcHandlers(): void {
|
||||
return engine.getAllForProject();
|
||||
});
|
||||
|
||||
safeHandle('importDefinitions:update', async (_, id: string, updates: any) => {
|
||||
safeHandle('importDefinitions:update', async (event, id: string, updates: any) => {
|
||||
const { ImportDefinitionEngine } = await import('../engine/ImportDefinitionEngine');
|
||||
const engine = new ImportDefinitionEngine();
|
||||
const projectEngine = getProjectEngine();
|
||||
@@ -850,7 +850,12 @@ export function registerIpcHandlers(): void {
|
||||
if (activeProject) {
|
||||
engine.setProjectContext(activeProject.id);
|
||||
}
|
||||
return engine.updateDefinition(id, updates);
|
||||
const result = await engine.updateDefinition(id, updates);
|
||||
// Notify renderer of name changes for sidebar/tab updates
|
||||
if (result && updates.name !== undefined) {
|
||||
event.sender.send('importDefinition-name-updated', { definitionId: id, name: result.name });
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
safeHandle('importDefinitions:delete', async (_, id: string) => {
|
||||
|
||||
@@ -164,6 +164,11 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
getAll: () => ipcRenderer.invoke('importDefinitions:getAll'),
|
||||
update: (id: string, updates: unknown) => ipcRenderer.invoke('importDefinitions:update', id, updates),
|
||||
delete: (id: string) => ipcRenderer.invoke('importDefinitions:delete', id),
|
||||
onNameUpdated: (callback: (data: { definitionId: string; name: string }) => void) => {
|
||||
const subscription = (_event: Electron.IpcRendererEvent, data: { definitionId: string; name: string }) => callback(data);
|
||||
ipcRenderer.on('importDefinition-name-updated', subscription);
|
||||
return () => ipcRenderer.removeListener('importDefinition-name-updated', subscription);
|
||||
},
|
||||
},
|
||||
|
||||
// AI Chat (OpenCode Zen API integration)
|
||||
|
||||
Reference in New Issue
Block a user