WIP: BROKEN FOR ELECTRON: Fixes in progress

This commit is contained in:
Matthew Raymer
2025-05-28 13:09:51 +00:00
parent 29908b77e3
commit 229d9184b2
20 changed files with 671 additions and 615 deletions

View File

@@ -1,11 +1,15 @@
import { initBackend } from "absurd-sql/dist/indexeddb-main-thread";
import { initializeApp } from "./main.common";
import { logger } from "./utils/logger";
const platform = process.env.VITE_PLATFORM;
const pwa_enabled = process.env.VITE_PWA_ENABLED === "true";
logger.error("[Web] PWA enabled", { pwa_enabled });
logger.error("[Web] Platform", { platform });
// Only import service worker for web builds
if (
process.env.VITE_PLATFORM !== "electron" &&
process.env.VITE_PWA_ENABLED === "true"
) {
if (platform !== "electron" && pwa_enabled) {
import("./registerServiceWorker"); // Web PWA support
}
@@ -24,6 +28,10 @@ function sqlInit() {
// workers through the main thread
initBackend(worker);
}
sqlInit();
if (platform === "web" || platform === "development") {
sqlInit();
} else {
logger.info("[Web] SQL not initialized for platform", { platform });
}
app.mount("#app");