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

@@ -22,12 +22,12 @@ interface AbsurdSqlDatabase {
) => Promise<{ changes: number; lastId?: number }>;
}
class AbsurdSqlDatabaseService implements DatabaseService {
class AbsurdSqlDatabaseService<T> implements DatabaseService {
private static instance: AbsurdSqlDatabaseService | null = null;
private db: AbsurdSqlDatabase | null;
private initialized: boolean;
private initializationPromise: Promise<void> | null = null;
private operationQueue: Array<QueuedOperation<any>> = [];
private operationQueue: Array<QueuedOperation<T>> = [];
private isProcessingQueue: boolean = false;
private constructor() {

View File

@@ -4,7 +4,13 @@ import {
StartScanOptions,
LensFacing,
} from "@capacitor-mlkit/barcode-scanning";
import { QRScannerService, ScanListener, QRScannerOptions, CameraStateListener, CameraState } from "./types";
import {
QRScannerService,
ScanListener,
QRScannerOptions,
CameraStateListener,
CameraState,
} from "./types";
import { logger } from "@/utils/logger";
export class CapacitorQRScanner implements QRScannerService {
@@ -96,7 +102,10 @@ export class CapacitorQRScanner implements QRScannerService {
// Check if scanning is supported
if (!(await this.isSupported())) {
this.updateCameraState("error", "QR scanning not supported on this device");
this.updateCameraState(
"error",
"QR scanning not supported on this device",
);
throw new Error("QR scanning not supported on this device");
}

View File

@@ -512,7 +512,10 @@ export class WebInlineQRScanner implements QRScannerService {
this.scanAttempts = 0;
this.lastScanTime = Date.now();
this.updateCameraState("initializing", "Starting camera...");
logger.error(`[WebInlineQRScanner:${this.id}] Starting scan with options:`, this.options);
logger.error(
`[WebInlineQRScanner:${this.id}] Starting scan with options:`,
this.options,
);
// Get camera stream with options
logger.error(

View File

@@ -121,10 +121,10 @@ export class DeepLinkHandler {
// Validate route exists before proceeding
if (!this.ROUTE_MAP[routePath]) {
throw {
code: "INVALID_ROUTE",
throw {
code: "INVALID_ROUTE",
message: `Invalid route path: ${routePath}`,
details: { routePath }
details: { routePath },
};
}