forked from jsnbuchanan/crowd-funder-for-time-pwa
add invite-one-accept screen dedicated to accepting invitations
This commit is contained in:
@@ -440,7 +440,7 @@ export default class ContactsView extends Vue {
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "warning",
|
||||
type: "danger",
|
||||
title: "Blank Invite",
|
||||
text: "The invite was not included, which can happen when your iOS device cuts off the link. Try pasting the full link into a browser.",
|
||||
},
|
||||
@@ -474,29 +474,36 @@ export default class ContactsView extends Vue {
|
||||
3000,
|
||||
);
|
||||
|
||||
// wait for a second before continuing so they see the registration message
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
|
||||
// now add the inviter as a contact
|
||||
// (similar code is in InviteOneAcceptView.vue)
|
||||
const payload: JWTPayload =
|
||||
decodeEndorserJwt(importedInviteJwt).payload;
|
||||
const registration = payload as VerifiableCredential;
|
||||
(this.$refs.contactNameDialog as ContactNameDialog).open(
|
||||
"Who Invited You?",
|
||||
"",
|
||||
(name) => {
|
||||
// not doing await on purpose, so that they always see the onboarding
|
||||
this.addContact({
|
||||
async (name) => {
|
||||
await this.addContact({
|
||||
did: registration.vc.credentialSubject.agent.identifier,
|
||||
name: name,
|
||||
registered: true,
|
||||
});
|
||||
// wait for a second before continuing so they see the user-added message
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
this.showOnboardingInfo();
|
||||
},
|
||||
() => {
|
||||
// not doing await on purpose, so that they always see the onboarding
|
||||
this.addContact({
|
||||
async () => {
|
||||
// on cancel, will still add the contact
|
||||
await this.addContact({
|
||||
did: registration.vc.credentialSubject.agent.identifier,
|
||||
name: "(person who invited you)",
|
||||
registered: true,
|
||||
});
|
||||
// wait for a second before continuing so they see the user-added message
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
this.showOnboardingInfo();
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user