forked from trent_larson/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:
@@ -136,7 +136,26 @@ export async function retrieveSettingsForActiveAccount(): Promise<Settings> {
|
||||
);
|
||||
|
||||
// Merge settings
|
||||
const settings = { ...defaultSettings, ...overrideSettingsFiltered };
|
||||
let settings = { ...defaultSettings, ...overrideSettingsFiltered };
|
||||
|
||||
// **ELECTRON-SPECIFIC FIX**: Force production API endpoints for Electron
|
||||
// This ensures Electron doesn't use localhost development servers that might be saved in user settings
|
||||
if (process.env.VITE_PLATFORM === "electron") {
|
||||
// Import constants dynamically to get platform-specific values
|
||||
const { DEFAULT_ENDORSER_API_SERVER } = await import(
|
||||
"../constants/app"
|
||||
);
|
||||
|
||||
settings = {
|
||||
...settings,
|
||||
apiServer: DEFAULT_ENDORSER_API_SERVER,
|
||||
// Note: partnerApiServer and imageServer are handled by constants/app.ts
|
||||
};
|
||||
|
||||
logger.debug(
|
||||
`[Electron Settings] Forced API server to: ${DEFAULT_ENDORSER_API_SERVER}`,
|
||||
);
|
||||
}
|
||||
|
||||
// Handle searchBoxes parsing
|
||||
if (settings.searchBoxes) {
|
||||
|
||||
Reference in New Issue
Block a user