Browse Source

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

pull/115/head
Trent Larson 7 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"
type: string; // "toast" | "info" | "success" | "warning" | "danger"
title: string;
text: string;
text?: string;
onCancel?: (stopAsking: boolean) => Promise<void>;
onNo?: (stopAsking: boolean) => Promise<void>;
onYes?: () => Promise<void>;

6
src/views/AccountViewView.vue

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

15
src/views/ContactsView.vue

@ -301,7 +301,7 @@
</template>
<script lang="ts">
import {Axios, AxiosError} from "axios";
import { AxiosError } from "axios";
import { IndexableType } from "dexie";
import * as R from "ramda";
import { IIdentifier } from "@veramo/core";
@ -309,7 +309,7 @@ import { Component, Vue } from "vue-facing-decorator";
import { Router } from "vue-router";
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 { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
import { accessToken, getContactPayloadFromJwtUrl } from "@/libs/crypto";
@ -330,7 +330,6 @@ import OfferDialog from "@/components/OfferDialog.vue";
import { Account } from "@/db/tables/accounts";
import { Buffer } from "buffer/";
import {getIdentity} from "@/libs/util";
@Component({
components: { GiftedDialog, EntityIcon, OfferDialog, QuickNav },
@ -825,15 +824,7 @@ export default class ContactsView extends Vue {
}
async register(contact: Contact) {
this.$notify(
{
group: "alert",
type: "toast",
text: "",
title: "Registration submitted...",
},
1000,
);
this.$notify({ group: "alert", type: "toast", title: "Sent..." }, 1000);
try {
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 identity = await libsUtil.getIdentity(activeDid);
this.$notify({ group: "alert", type: "toast", title: "Sent..." }, 1000);
// first send the claim for time given
let timeSuccess = false;
if (this.gaveTime && hoursNum > 0) {

12
src/views/QuickActionBvcEndView.vue

@ -260,7 +260,7 @@ export default class QuickActionBvcBeginView extends Vue {
title: "Error",
text: "There was an error retrieving today's claims to confirm.",
},
-1,
5000,
);
}
this.loadingConfirms = false;
@ -277,6 +277,8 @@ export default class QuickActionBvcBeginView extends Vue {
try {
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
const confirmResults = await Promise.allSettled(
this.claimsToConfirmSelected.map(async (jwtId) => {
@ -312,7 +314,7 @@ export default class QuickActionBvcBeginView extends Vue {
title: "Error",
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 ||
"There was an error sending that give.",
},
-1,
5000,
);
}
}
@ -367,7 +369,7 @@ export default class QuickActionBvcBeginView extends Vue {
title: "Success",
text: actions,
},
-1,
3000,
);
}
@ -381,7 +383,7 @@ export default class QuickActionBvcBeginView extends Vue {
title: "Error",
text: error.userMessage || "There was an error sending claims.",
},
-1,
5000,
);
}
}

Loading…
Cancel
Save