forked from jsnbuchanan/crowd-funder-for-time-pwa
# Commit Message for SharedArrayBuffer Platform Exclusion
fix: eliminate SharedArrayBuffer checks on non-web platforms * Add platform guard in AbsurdSqlDatabaseService to only initialize on web * Change singleton pattern from eager to lazy instantiation * Update worker import to use lazy singleton pattern * Prevents absurd-sql initialization on Electron/Capacitor platforms * Reduces console noise and memory footprint on desktop/mobile * Maintains full web platform functionality and performance Resolves SharedArrayBuffer-related console output on Electron platform while preserving all web features and maintaining clean architecture.
This commit is contained in:
@@ -29,10 +29,11 @@ let databaseService = null;
|
||||
async function getDatabaseService() {
|
||||
if (!databaseService) {
|
||||
// Dynamic import to prevent circular dependency
|
||||
const { default: service } = await import(
|
||||
const { default: AbsurdSqlDatabaseService } = await import(
|
||||
"./services/AbsurdSqlDatabaseService"
|
||||
);
|
||||
databaseService = service;
|
||||
// Get the singleton instance (only created when needed)
|
||||
databaseService = AbsurdSqlDatabaseService.getInstance();
|
||||
}
|
||||
return databaseService;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user