forked from trent_larson/crowd-funder-for-time-pwa
Fix: pass project info
In GiftingDialog, project information is passed along if: - Selecting "Show All" to go to ContactGiftingView - Selecting "Photos and Other Options" to go to GiftedDetailsView
This commit is contained in:
@@ -91,7 +91,15 @@
|
|||||||
</li>
|
</li>
|
||||||
<li v-if="allContacts.length > 0">
|
<li v-if="allContacts.length > 0">
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'contact-gift' }"
|
:to="{
|
||||||
|
name: 'contact-gift',
|
||||||
|
query: {
|
||||||
|
recipientProjectId: toProjectId,
|
||||||
|
recipientProjectName: giver?.name,
|
||||||
|
recipientProjectImage: giver?.image,
|
||||||
|
recipientProjectHandleId: giver?.handleId
|
||||||
|
}
|
||||||
|
}"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
>
|
>
|
||||||
<font-awesome icon="circle-right" class="text-blue-500 text-5xl mb-1" />
|
<font-awesome icon="circle-right" class="text-blue-500 text-5xl mb-1" />
|
||||||
@@ -503,15 +511,15 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.apiServer,
|
this.apiServer,
|
||||||
this.activeDid,
|
this.activeDid,
|
||||||
this.showProjects ? undefined : giverDid as string,
|
this.showProjects ? undefined : giverDid as string,
|
||||||
recipientDid as string,
|
this.showProjects && this.isFromProjectView ? this.giver?.handleId : recipientDid as string,
|
||||||
description,
|
description,
|
||||||
amount,
|
amount,
|
||||||
unitCode,
|
unitCode,
|
||||||
this.toProjectId,
|
this.showProjects && this.isFromProjectView ? this.giver?.handleId : this.toProjectId,
|
||||||
this.offerId,
|
this.offerId,
|
||||||
false,
|
false,
|
||||||
undefined,
|
undefined,
|
||||||
this.showProjects ? this.giver?.handleId : undefined,
|
this.showProjects && !this.isFromProjectView ? this.giver?.handleId : undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
|||||||
@@ -97,6 +97,9 @@ export default class ContactGiftingView extends Vue {
|
|||||||
description = "";
|
description = "";
|
||||||
projectId = "";
|
projectId = "";
|
||||||
prompt = "";
|
prompt = "";
|
||||||
|
recipientProjectName = "";
|
||||||
|
recipientProjectImage = "";
|
||||||
|
recipientProjectHandleId = "";
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
try {
|
try {
|
||||||
@@ -124,7 +127,10 @@ export default class ContactGiftingView extends Vue {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.projectId = (this.$route.query["projectId"] as string) || "";
|
this.projectId = (this.$route.query["recipientProjectId"] as string) || "";
|
||||||
|
this.recipientProjectName = (this.$route.query["recipientProjectName"] as string) || "";
|
||||||
|
this.recipientProjectImage = (this.$route.query["recipientProjectImage"] as string) || "";
|
||||||
|
this.recipientProjectHandleId = (this.$route.query["recipientProjectHandleId"] as string) || "";
|
||||||
this.prompt = (this.$route.query["prompt"] as string) ?? this.prompt;
|
this.prompt = (this.$route.query["prompt"] as string) ?? this.prompt;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
@@ -146,7 +152,12 @@ export default class ContactGiftingView extends Vue {
|
|||||||
|
|
||||||
openDialog(giver?: GiverReceiverInputInfo | "Unnamed") {
|
openDialog(giver?: GiverReceiverInputInfo | "Unnamed") {
|
||||||
const recipient = this.projectId
|
const recipient = this.projectId
|
||||||
? undefined
|
? {
|
||||||
|
did: this.recipientProjectHandleId,
|
||||||
|
name: this.recipientProjectName,
|
||||||
|
image: this.recipientProjectImage,
|
||||||
|
handleId: this.recipientProjectHandleId
|
||||||
|
}
|
||||||
: { did: this.activeDid, name: "you" };
|
: { did: this.activeDid, name: "you" };
|
||||||
|
|
||||||
if (giver === "Unnamed") {
|
if (giver === "Unnamed") {
|
||||||
|
|||||||
Reference in New Issue
Block a user