forked from trent_larson/crowd-funder-for-time-pwa
show a better message when admission to an onboarding meeting succeeds but registration fails
This commit is contained in:
@@ -392,39 +392,44 @@ export default class MembersList extends Vue {
|
|||||||
did: member.did,
|
did: member.did,
|
||||||
name: member.name,
|
name: member.name,
|
||||||
}
|
}
|
||||||
const result = await register(
|
try {
|
||||||
this.activeDid,
|
const result = await register(
|
||||||
this.apiServer,
|
this.activeDid,
|
||||||
this.axios,
|
this.apiServer,
|
||||||
contactOldOrNew,
|
this.axios,
|
||||||
);
|
contactOldOrNew,
|
||||||
if (result.success) {
|
|
||||||
member.member.registered = true;
|
|
||||||
if (oldContact) {
|
|
||||||
await db.contacts.update(member.did, { registered: true });
|
|
||||||
oldContact.registered = true;
|
|
||||||
}
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "success",
|
|
||||||
title: "Registered",
|
|
||||||
text: "Besides being admitted, they were also registered.",
|
|
||||||
},
|
|
||||||
3000,
|
|
||||||
);
|
);
|
||||||
} else {
|
if (result.success) {
|
||||||
const additionalInfo = result.error || "";
|
member.member.registered = true;
|
||||||
|
if (oldContact) {
|
||||||
|
await db.contacts.update(member.did, { registered: true });
|
||||||
|
oldContact.registered = true;
|
||||||
|
}
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "success",
|
||||||
|
title: "Registered",
|
||||||
|
text: "Besides being admitted, they were also registered.",
|
||||||
|
},
|
||||||
|
3000,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
throw result;
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
} catch (error: any) {
|
||||||
|
// registration failure is likely explained by a message from the server
|
||||||
|
const additionalInfo = serverMessageForUser(error) || error?.error || "";
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "warning",
|
||||||
title: "Registration failed",
|
title: "Registration failed",
|
||||||
text:
|
text: "They were admitted to the meeting. However, registration failed. You can register them from the contacts screen. " +
|
||||||
"They were admitted, but registration failed. You can try again, or register from your contacts screen. " +
|
|
||||||
additionalInfo,
|
additionalInfo,
|
||||||
},
|
},
|
||||||
10000,
|
12000,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user