WIP: BROKEN FOR ELECTRON: Fixes in progress
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user