feat: close theme editor if the theme was deleted

This commit is contained in:
Hachi-R
2025-01-30 09:43:58 -03:00
parent d91d8dd26f
commit 964e9bbb2b
7 changed files with 30 additions and 0 deletions

View File

@@ -255,6 +255,19 @@ export class WindowManager {
}
}
public static closeEditorWindow(themeId?: string) {
if (themeId) {
const editorWindow = this.editorWindows.get(themeId);
if (editorWindow) {
editorWindow.close();
}
} else {
this.editorWindows.forEach((editorWindow) => {
editorWindow.close();
});
}
}
public static redirect(hash: string) {
if (!this.mainWindow) this.createMainWindow();
this.loadMainWindowURL(hash);