feat: shadow dom to isolate achievements window and custom css refactor

This commit is contained in:
Zamitto
2025-05-17 23:48:30 -03:00
parent 4485f62946
commit 0b83554565
14 changed files with 118 additions and 71 deletions

View File

@@ -1,5 +1,6 @@
import { themesSublevel } from "@main/level";
import { registerEvent } from "../register-event";
import { WindowManager } from "@main/services";
const toggleCustomTheme = async (
_event: Electron.IpcMainInvokeEvent,
@@ -17,6 +18,8 @@ const toggleCustomTheme = async (
isActive,
updatedAt: new Date(),
});
WindowManager.notificationWindow?.webContents.send("on-custom-theme-updated");
};
registerEvent("toggleCustomTheme", toggleCustomTheme);

View File

@@ -20,8 +20,10 @@ const updateCustomTheme = async (
});
if (theme.isActive) {
WindowManager.mainWindow?.webContents.send("css-injected", code);
WindowManager.notificationWindow?.webContents.send("css-injected", code);
WindowManager.mainWindow?.webContents.send("on-custom-theme-updated");
WindowManager.notificationWindow?.webContents.send(
"on-custom-theme-updated"
);
}
};