|
|
@ -430,13 +430,11 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
import { AxiosError } from "axios"; |
|
|
|
import * as yaml from "js-yaml"; |
|
|
|
import * as R from "ramda"; |
|
|
|
import { Component, Vue } from "vue-facing-decorator"; |
|
|
|
import { useClipboard } from "@vueuse/core"; |
|
|
|
import { RouteLocationNormalizedLoaded, Router } from "vue-router"; |
|
|
|
import { GenericVerifiableCredential } from "../interfaces"; |
|
|
|
import QuickNav from "../components/QuickNav.vue"; |
|
|
|
import { NotificationIface } from "../constants/app"; |
|
|
|
import { db, retrieveSettingsForActiveAccount } from "../db/index"; |
|
|
@ -445,7 +443,7 @@ import * as serverUtil from "../libs/endorserServer"; |
|
|
|
import { GiveSummaryRecord } from "../interfaces"; |
|
|
|
import { displayAmount } from "../libs/endorserServer"; |
|
|
|
import * as libsUtil from "../libs/util"; |
|
|
|
import { isGiveAction, retrieveAccountDids } from "../libs/util"; |
|
|
|
import { retrieveAccountDids } from "../libs/util"; |
|
|
|
import TopMessage from "../components/TopMessage.vue"; |
|
|
|
|
|
|
|
/** |
|
|
@ -545,7 +543,9 @@ export default class ConfirmGiftView extends Vue { |
|
|
|
* Loads and processes claim from URL parameters |
|
|
|
*/ |
|
|
|
private async loadClaimFromUrl() { |
|
|
|
const pathParam = window.location.pathname.substring("/confirm-gift/".length); |
|
|
|
const pathParam = window.location.pathname.substring( |
|
|
|
"/confirm-gift/".length, |
|
|
|
); |
|
|
|
if (!pathParam) { |
|
|
|
throw new Error("No claim ID was provided."); |
|
|
|
} |
|
|
@ -563,7 +563,8 @@ export default class ConfirmGiftView extends Vue { |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
|
title: "Error", |
|
|
|
text: error instanceof Error ? error.message : "No claim ID was provided.", |
|
|
|
text: |
|
|
|
error instanceof Error ? error.message : "No claim ID was provided.", |
|
|
|
}, |
|
|
|
3000, |
|
|
|
); |
|
|
@ -683,7 +684,10 @@ export default class ConfirmGiftView extends Vue { |
|
|
|
if (this.giveDetails?.fullClaim.image) { |
|
|
|
this.urlForNewGive += `&image=${encodeURIComponent(this.giveDetails.fullClaim.image)}`; |
|
|
|
} |
|
|
|
if (this.giveDetails?.type === "Offer" && this.giveDetails?.fulfillsHandleId) { |
|
|
|
if ( |
|
|
|
this.giveDetails?.type === "Offer" && |
|
|
|
this.giveDetails?.fulfillsHandleId |
|
|
|
) { |
|
|
|
this.urlForNewGive += `&offerId=${encodeURIComponent(this.giveDetails.fulfillsHandleId)}`; |
|
|
|
} |
|
|
|
if (this.giveDetails?.fulfillsPlanHandleId) { |
|
|
@ -725,17 +729,6 @@ export default class ConfirmGiftView extends Vue { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Formats display amount with proper unit |
|
|
|
* |
|
|
|
* @param unit - Currency or unit code |
|
|
|
* @param amount - Numeric amount |
|
|
|
* @returns Formatted amount string |
|
|
|
*/ |
|
|
|
displayAmount(unit: string, amount: number): string { |
|
|
|
return displayAmount(unit, amount); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Retrieves human-readable name for a DID |
|
|
|
* Falls back to DID if no name available |
|
|
@ -831,10 +824,7 @@ export default class ConfirmGiftView extends Vue { |
|
|
|
* @param prefix - Optional prefix to add |
|
|
|
* @returns Formatted string |
|
|
|
*/ |
|
|
|
capitalizeAndInsertSpacesBeforeCapsWithAPrefix( |
|
|
|
text: string, |
|
|
|
prefix?: string |
|
|
|
): string { |
|
|
|
capitalizeAndInsertSpacesBeforeCapsWithAPrefix(text: string): string { |
|
|
|
const word = this.capitalizeAndInsertSpacesBeforeCaps(text); |
|
|
|
if (word) { |
|
|
|
// if the word starts with a vowel, use "an" instead of "a" |
|
|
|