forked from trent_larson/crowd-funder-for-time-pwa
Fix HomeView registration status by using $accountSettings() instead of $settings()
- Change HomeView to use $accountSettings() method which returns correct isRegistered value - Remove isRegistered: false default that was overriding database values - Fix settings override issue where empty defaults were overriding activeDid - Remove excessive settings tracing logs to clean up console output - Ensure consistent registration status between HomeView and AccountViewView The HomeView was incorrectly showing users as unregistered while AccountViewView showed them as registered due to using $settings() (returns null) instead of $accountSettings() (returns correct database value).
This commit is contained in:
@@ -459,13 +459,10 @@ export const PlatformServiceMixin = {
|
||||
|
||||
return settings;
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`[${(this as unknown as VueComponentWithMixin).$options.name}] Failed to get settings:`,
|
||||
{
|
||||
key,
|
||||
error,
|
||||
},
|
||||
);
|
||||
logger.error(`[Settings Trace] ❌ Failed to get settings:`, {
|
||||
key,
|
||||
error,
|
||||
});
|
||||
return fallback;
|
||||
}
|
||||
},
|
||||
@@ -533,14 +530,11 @@ export const PlatformServiceMixin = {
|
||||
|
||||
return mergedSettings;
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`[${(this as unknown as VueComponentWithMixin).$options.name}] Failed to get merged settings:`,
|
||||
{
|
||||
defaultKey,
|
||||
accountDid,
|
||||
error,
|
||||
},
|
||||
);
|
||||
logger.error(`[Settings Trace] ❌ Failed to get merged settings:`, {
|
||||
defaultKey,
|
||||
accountDid,
|
||||
error,
|
||||
});
|
||||
return defaultFallback;
|
||||
}
|
||||
},
|
||||
@@ -748,25 +742,20 @@ export const PlatformServiceMixin = {
|
||||
);
|
||||
|
||||
mergedSettings.apiServer = DEFAULT_ENDORSER_API_SERVER;
|
||||
|
||||
logger.debug(
|
||||
`[Electron Settings] Forced API server to: ${DEFAULT_ENDORSER_API_SERVER}`,
|
||||
);
|
||||
}
|
||||
|
||||
// Merge with any provided defaults (these take highest precedence)
|
||||
const finalSettings = { ...mergedSettings, ...defaults };
|
||||
|
||||
console.log(
|
||||
"[PlatformServiceMixin] $accountSettings",
|
||||
JSON.stringify(finalSettings, null, 2),
|
||||
// Filter out undefined and empty string values to prevent overriding real settings
|
||||
const filteredDefaults = Object.fromEntries(
|
||||
Object.entries(defaults).filter(
|
||||
([_, value]) => value !== undefined && value !== "",
|
||||
),
|
||||
);
|
||||
|
||||
const finalSettings = { ...mergedSettings, ...filteredDefaults };
|
||||
return finalSettings;
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
"[PlatformServiceMixin] Error in $accountSettings:",
|
||||
error,
|
||||
);
|
||||
logger.error("[Settings Trace] ❌ Error in $accountSettings:", error);
|
||||
|
||||
// Fallback to defaults on error
|
||||
return defaults;
|
||||
|
||||
Reference in New Issue
Block a user