refactor(services): align Capacitor and Web platform services with active_identity architecture
- Update CapacitorPlatformService.updateDefaultSettings() to use active_identity table instead of hard-coded id=1 - Update CapacitorPlatformService.retrieveSettingsForActiveAccount() to query by accountDid from active_identity - Add getActiveIdentity() method to CapacitorPlatformService for consistency with WebPlatformService - Update WebPlatformService.retrieveSettingsForActiveAccount() to match CapacitorPlatformService pattern - Both services now consistently use active_identity table instead of legacy MASTER_SETTINGS_KEY approach - Maintains backward compatibility with databaseUtil.ts for PWA migration support Technical details: - CapacitorPlatformService: Fixed hard-coded WHERE id = 1 → WHERE accountDid = ? - WebPlatformService: Fixed retrieval pattern to match new architecture - Platform services now aligned with migration 004 active_identity table schema - databaseUtil.ts remains unchanged for PWA-to-SQLite migration bridge
This commit is contained in:
@@ -1413,7 +1413,10 @@ export class CapacitorPlatformService implements PlatformService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await this.dbQuery("SELECT * FROM settings WHERE accountDid = ?", [activeDid]);
|
const result = await this.dbQuery(
|
||||||
|
"SELECT * FROM settings WHERE accountDid = ?",
|
||||||
|
[activeDid],
|
||||||
|
);
|
||||||
if (result?.values?.[0]) {
|
if (result?.values?.[0]) {
|
||||||
// Convert the row to an object
|
// Convert the row to an object
|
||||||
const row = result.values[0];
|
const row = result.values[0];
|
||||||
|
|||||||
@@ -761,7 +761,10 @@ export class WebPlatformService implements PlatformService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await this.dbQuery("SELECT * FROM settings WHERE accountDid = ?", [activeDid]);
|
const result = await this.dbQuery(
|
||||||
|
"SELECT * FROM settings WHERE accountDid = ?",
|
||||||
|
[activeDid],
|
||||||
|
);
|
||||||
if (result?.values?.[0]) {
|
if (result?.values?.[0]) {
|
||||||
// Convert the row to an object
|
// Convert the row to an object
|
||||||
const row = result.values[0];
|
const row = result.values[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user