forked from jsnbuchanan/crowd-funder-for-time-pwa
fix(platform): remove auto-fix identity selection and fix feed loading race condition
- Remove problematic $ensureActiveIdentityPopulated() that auto-selected identities - Add user-friendly $needsActiveIdentitySelection() and $getAvailableAccountDids() methods - Fix missing updateActiveDid implementation in CapacitorPlatformService - Resolve race condition in HomeView initialization causing feed loading failures - Improve TypeScript error handling in ContactsView invite processing Addresses team concerns about data consistency and user control for identity selection.
This commit is contained in:
@@ -359,9 +359,6 @@ export default class ContactsView extends Vue {
|
||||
activeDid: this.activeDid,
|
||||
});
|
||||
|
||||
// Ensure active_identity is populated before processing invite
|
||||
await this.$ensureActiveIdentityPopulated();
|
||||
|
||||
// Re-fetch settings after ensuring active_identity is populated
|
||||
const updatedSettings = await this.$accountSettings();
|
||||
this.activeDid = updatedSettings.activeDid || "";
|
||||
@@ -448,17 +445,28 @@ export default class ContactsView extends Vue {
|
||||
this.$logAndConsole(fullError, true);
|
||||
let message = "Got an error sending the invite.";
|
||||
if (
|
||||
error &&
|
||||
typeof error === "object" &&
|
||||
"response" in error &&
|
||||
error.response &&
|
||||
typeof error.response === "object" &&
|
||||
"data" in error.response &&
|
||||
error.response.data &&
|
||||
error.response.data.error
|
||||
typeof error.response.data === "object" &&
|
||||
"error" in error.response.data
|
||||
) {
|
||||
if (error.response.data.error.message) {
|
||||
message = error.response.data.error.message;
|
||||
const responseData = error.response.data as { error: unknown };
|
||||
if (
|
||||
responseData.error &&
|
||||
typeof responseData.error === "object" &&
|
||||
"message" in responseData.error
|
||||
) {
|
||||
message = (responseData.error as { message: string }).message;
|
||||
} else {
|
||||
message = error.response.data.error;
|
||||
message = String(responseData.error);
|
||||
}
|
||||
} else if (error.message) {
|
||||
message = error.message;
|
||||
} else if (error && typeof error === "object" && "message" in error) {
|
||||
message = (error as { message: string }).message;
|
||||
}
|
||||
this.notify.error(message, TIMEOUTS.MODAL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user