convert all remaining DB writes & reads to SQL (with successful registration & claim)

This commit is contained in:
2025-05-27 21:07:24 -06:00
parent f0d8fdf98c
commit 8092d1c576
67 changed files with 1200 additions and 266 deletions

View File

@@ -3,17 +3,20 @@
import { register } from "register-service-worker";
// Check if we're in an Electron environment
const isElectron = process.env.VITE_PLATFORM === 'electron' ||
process.env.VITE_DISABLE_PWA === 'true' ||
window.navigator.userAgent.toLowerCase().includes('electron');
const isElectron =
process.env.VITE_PLATFORM === "electron" ||
process.env.VITE_DISABLE_PWA === "true" ||
window.navigator.userAgent.toLowerCase().includes("electron");
// Only register service worker if:
// 1. Not in Electron
// 2. PWA is explicitly enabled
// 3. In production mode
if (!isElectron &&
process.env.VITE_PWA_ENABLED === "true" &&
process.env.NODE_ENV === "production") {
if (
!isElectron &&
process.env.VITE_PWA_ENABLED === "true" &&
process.env.NODE_ENV === "production"
) {
register(`${process.env.BASE_URL}sw.js`, {
ready() {
console.log("Service worker is active.");
@@ -42,11 +45,11 @@ if (!isElectron &&
} else {
console.log(
`Service worker registration skipped - ${
isElectron
? "running in Electron"
isElectron
? "running in Electron"
: process.env.VITE_PWA_ENABLED !== "true"
? "PWA not enabled"
: "not in production mode"
}`
}`,
);
}