fix: title update for import definitions

This commit is contained in:
2026-02-13 14:18:29 +01:00
parent 9169f2a34c
commit 4dc1a9f058
5 changed files with 45 additions and 2 deletions

View File

@@ -1293,6 +1293,23 @@ const ImportList: React.FC = () => {
init();
}, [loadDefinitions]);
// Listen for import definition name updates
useEffect(() => {
const unsub = window.electronAPI?.importDefinitions.onNameUpdated((data) => {
setDefinitions(prev =>
prev.map(def =>
def.id === data.definitionId
? { ...def, name: data.name }
: def
)
);
});
return () => {
unsub?.();
};
}, []);
const handleNewDefinition = async () => {
try {
const def = await window.electronAPI?.importDefinitions.create();