Browse Source

show something to indicate claims were sent (mostly in BVC screens)

kb/add-usage-guide
Trent Larson 5 months ago
parent
commit
9157837586
  1. 2
      src/constants/app.ts
  2. 6
      src/views/AccountViewView.vue
  3. 15
      src/views/ContactsView.vue
  4. 2
      src/views/QuickActionBvcBeginView.vue
  5. 12
      src/views/QuickActionBvcEndView.vue

2
src/constants/app.ts

@ -38,7 +38,7 @@ export interface NotificationIface {
group: string; // "alert" | "modal" group: string; // "alert" | "modal"
type: string; // "toast" | "info" | "success" | "warning" | "danger" type: string; // "toast" | "info" | "success" | "warning" | "danger"
title: string; title: string;
text: string; text?: string;
onCancel?: (stopAsking: boolean) => Promise<void>; onCancel?: (stopAsking: boolean) => Promise<void>;
onNo?: (stopAsking: boolean) => Promise<void>; onNo?: (stopAsking: boolean) => Promise<void>;
onYes?: () => Promise<void>; onYes?: () => Promise<void>;

6
src/views/AccountViewView.vue

@ -544,7 +544,11 @@
<!-- toggle --> <!-- toggle -->
<div class="relative ml-2"> <div class="relative ml-2">
<!-- input --> <!-- input -->
<input type="checkbox" v-model="hideRegisterPromptOnNewContact" class="sr-only" /> <input
type="checkbox"
v-model="hideRegisterPromptOnNewContact"
class="sr-only"
/>
<!-- line --> <!-- line -->
<div class="block bg-slate-500 w-14 h-8 rounded-full" /> <div class="block bg-slate-500 w-14 h-8 rounded-full" />
<!-- dot --> <!-- dot -->

15
src/views/ContactsView.vue

@ -301,7 +301,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import {Axios, AxiosError} from "axios"; import { AxiosError } from "axios";
import { IndexableType } from "dexie"; import { IndexableType } from "dexie";
import * as R from "ramda"; import * as R from "ramda";
import { IIdentifier } from "@veramo/core"; import { IIdentifier } from "@veramo/core";
@ -309,7 +309,7 @@ import { Component, Vue } from "vue-facing-decorator";
import { Router } from "vue-router"; import { Router } from "vue-router";
import { AppString, NotificationIface } from "@/constants/app"; import { AppString, NotificationIface } from "@/constants/app";
import {accountsDB, db, NonsensitiveDexie} from "@/db/index"; import { accountsDB, db } from "@/db/index";
import { Contact } from "@/db/tables/contacts"; import { Contact } from "@/db/tables/contacts";
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings"; import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
import { accessToken, getContactPayloadFromJwtUrl } from "@/libs/crypto"; import { accessToken, getContactPayloadFromJwtUrl } from "@/libs/crypto";
@ -330,7 +330,6 @@ import OfferDialog from "@/components/OfferDialog.vue";
import { Account } from "@/db/tables/accounts"; import { Account } from "@/db/tables/accounts";
import { Buffer } from "buffer/"; import { Buffer } from "buffer/";
import {getIdentity} from "@/libs/util";
@Component({ @Component({
components: { GiftedDialog, EntityIcon, OfferDialog, QuickNav }, components: { GiftedDialog, EntityIcon, OfferDialog, QuickNav },
@ -825,15 +824,7 @@ export default class ContactsView extends Vue {
} }
async register(contact: Contact) { async register(contact: Contact) {
this.$notify( this.$notify({ group: "alert", type: "toast", title: "Sent..." }, 1000);
{
group: "alert",
type: "toast",
text: "",
title: "Registration submitted...",
},
1000,
);
try { try {
const regResult = await register( const regResult = await register(

2
src/views/QuickActionBvcBeginView.vue

@ -126,6 +126,8 @@ export default class QuickActionBvcBeginView extends Vue {
const hoursNum = libsUtil.numberOrZero(this.hoursStr); const hoursNum = libsUtil.numberOrZero(this.hoursStr);
const identity = await libsUtil.getIdentity(activeDid); const identity = await libsUtil.getIdentity(activeDid);
this.$notify({ group: "alert", type: "toast", title: "Sent..." }, 1000);
// first send the claim for time given // first send the claim for time given
let timeSuccess = false; let timeSuccess = false;
if (this.gaveTime && hoursNum > 0) { if (this.gaveTime && hoursNum > 0) {

12
src/views/QuickActionBvcEndView.vue

@ -260,7 +260,7 @@ export default class QuickActionBvcBeginView extends Vue {
title: "Error", title: "Error",
text: "There was an error retrieving today's claims to confirm.", text: "There was an error retrieving today's claims to confirm.",
}, },
-1, 5000,
); );
} }
this.loadingConfirms = false; this.loadingConfirms = false;
@ -277,6 +277,8 @@ export default class QuickActionBvcBeginView extends Vue {
try { try {
const identity = await libsUtil.getIdentity(this.activeDid); const identity = await libsUtil.getIdentity(this.activeDid);
this.$notify({ group: "alert", type: "toast", title: "Sent..." }, 1000);
// in parallel, make a confirmation for each selected claim and send them all to the server // in parallel, make a confirmation for each selected claim and send them all to the server
const confirmResults = await Promise.allSettled( const confirmResults = await Promise.allSettled(
this.claimsToConfirmSelected.map(async (jwtId) => { this.claimsToConfirmSelected.map(async (jwtId) => {
@ -312,7 +314,7 @@ export default class QuickActionBvcBeginView extends Vue {
title: "Error", title: "Error",
text: `There was an error sending ${howMany} of the confirmations.`, text: `There was an error sending ${howMany} of the confirmations.`,
}, },
-1, 5000,
); );
} }
@ -342,7 +344,7 @@ export default class QuickActionBvcBeginView extends Vue {
(giveResult as ErrorResult)?.error?.userMessage || (giveResult as ErrorResult)?.error?.userMessage ||
"There was an error sending that give.", "There was an error sending that give.",
}, },
-1, 5000,
); );
} }
} }
@ -367,7 +369,7 @@ export default class QuickActionBvcBeginView extends Vue {
title: "Success", title: "Success",
text: actions, text: actions,
}, },
-1, 3000,
); );
} }
@ -381,7 +383,7 @@ export default class QuickActionBvcBeginView extends Vue {
title: "Error", title: "Error",
text: error.userMessage || "There was an error sending claims.", text: error.userMessage || "There was an error sending claims.",
}, },
-1, 5000,
); );
} }
} }

Loading…
Cancel
Save