diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue index b23400d..00256aa 100644 --- a/src/components/GiftedDialog.vue +++ b/src/components/GiftedDialog.vue @@ -7,7 +7,7 @@
@@ -89,11 +89,7 @@ import { Vue, Component, Prop } from "vue-facing-decorator"; import { NotificationIface } from "@/constants/app"; -import { - createAndSubmitGive, - didInfo, - GiverReceiverInputInfo, -} from "@/libs/endorserServer"; +import { createAndSubmitGive, didInfo } from "@/libs/endorserServer"; import * as libsUtil from "@/libs/util"; import { accountsDB, db } from "@/db/index"; import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings"; @@ -114,25 +110,27 @@ export default class GiftedDialog extends Vue { callbackOnSuccess?: (amount: number) => void = () => {}; customTitle?: string; description = ""; - giver?: GiverReceiverInputInfo; // undefined means no identified giver agent + giver?: libsUtil.GiverReceiverInputInfo; // undefined means no identified giver agent isTrade = false; offerId = ""; - receiver?: GiverReceiverInputInfo; + prompt = ""; + receiver?: libsUtil.GiverReceiverInputInfo; unitCode = "HUR"; visible = false; libsUtil = libsUtil; async open( - giver?: GiverReceiverInputInfo, - receiver?: GiverReceiverInputInfo, + giver?: libsUtil.GiverReceiverInputInfo, + receiver?: libsUtil.GiverReceiverInputInfo, offerId?: string, customTitle?: string, + prompt?: string, callbackOnSuccess?: (amount: number) => void, ) { this.customTitle = customTitle; - this.description = ""; this.giver = giver; + this.prompt = prompt || ""; this.receiver = receiver; // if we show "given to user" selection, default checkbox to true this.amountInput = "0"; @@ -207,6 +205,7 @@ export default class GiftedDialog extends Vue { this.description = ""; this.giver = undefined; this.amountInput = "0"; + this.prompt = ""; this.unitCode = "HUR"; } diff --git a/src/components/GiftedPrompts.vue b/src/components/GiftedPrompts.vue index 798bbee..626df71 100644 --- a/src/components/GiftedPrompts.vue +++ b/src/components/GiftedPrompts.vue @@ -19,12 +19,12 @@
- +

{{ IDEAS[currentIdeaIndex] }}

-
+

@@ -71,150 +71,168 @@ diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index 4747408..f230bdc 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -8,7 +8,11 @@ import { DEFAULT_IMAGE_API_SERVER } from "@/constants/app"; import { Contact } from "@/db/tables/contacts"; import { accessToken, deriveAddress, nextDerivationPath } from "@/libs/crypto"; import { NonsensitiveDexie } from "@/db/index"; -import { getAccount, getPasskeyExpirationSeconds } from "@/libs/util"; +import { + getAccount, + getPasskeyExpirationSeconds, + GiverReceiverInputInfo, +} from "@/libs/util"; import { createEndorserJwtForKey, KeyMeta } from "@/libs/crypto/vc"; import { Account } from "@/db/tables/accounts"; @@ -32,11 +36,6 @@ export interface AgreeVerifiableCredential { object: Record; } -export interface GiverReceiverInputInfo { - did?: string; - name?: string; -} - export interface GiverOutputInfo { action: string; giver?: GiverReceiverInputInfo; diff --git a/src/libs/util.ts b/src/libs/util.ts index 9830ee7..ada548e 100644 --- a/src/libs/util.ts +++ b/src/libs/util.ts @@ -25,6 +25,11 @@ import { KeyMeta } from "@/libs/crypto/vc"; import { createPeerDid } from "@/libs/crypto/vc/didPeer"; import { registerCredential } from "@/libs/crypto/vc/passkeyDidPeer"; +export interface GiverReceiverInputInfo { + did?: string; + name?: string; +} + export const PRIVACY_MESSAGE = "The data you send will be visible to the world -- except: your IDs and the IDs of anyone you tag will stay private, only visible to them and others you explicitly allow."; export const SHARED_PHOTO_BASE64_KEY = "shared-photo-base64"; diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue index 85bbb57..9d317fb 100644 --- a/src/views/ClaimView.vue +++ b/src/views/ClaimView.vue @@ -463,7 +463,6 @@ import QuickNav from "@/components/QuickNav.vue"; import { Account } from "@/db/tables/accounts"; import { GenericCredWrapper, - GiverReceiverInputInfo, OfferVerifiableCredential, } from "@/libs/endorserServer"; @@ -811,7 +810,7 @@ export default class ClaimView extends Vue { } openFulfillGiftDialog() { - const giver: GiverReceiverInputInfo = { + const giver: libsUtil.GiverReceiverInputInfo = { did: libsUtil.offerGiverDid( this.veriClaim as GenericCredWrapper, ), diff --git a/src/views/ContactGiftingView.vue b/src/views/ContactGiftingView.vue index f96d97e..1c2abfe 100644 --- a/src/views/ContactGiftingView.vue +++ b/src/views/ContactGiftingView.vue @@ -11,8 +11,7 @@ class="text-lg text-center px-2 py-1 absolute -left-2 -top-1" > - - Give to Contacts + Given by...

@@ -72,6 +71,7 @@