diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue
index e832a44c..5e377ad7 100644
--- a/src/components/GiftedDialog.vue
+++ b/src/components/GiftedDialog.vue
@@ -9,7 +9,10 @@
- -
+
-
@@ -129,17 +129,31 @@ export default class ContactGiftingView extends Vue {
}
}
- openDialog(giver?: GiverReceiverInputInfo) {
+ openDialog(giver?: GiverReceiverInputInfo | "Unnamed") {
const recipient = this.projectId
? undefined
: { did: this.activeDid, name: "you" };
- (this.$refs.customDialog as GiftedDialog).open(
- giver,
- recipient,
- undefined,
- "Given by " + (giver?.name || "someone not named"),
- this.prompt,
- );
+
+ if (giver === "Unnamed") {
+ // Special case: Pass undefined to trigger Step 1, but with "Unnamed" pre-selected
+ (this.$refs.customDialog as GiftedDialog).open(
+ undefined,
+ recipient,
+ undefined,
+ "Given by Unnamed",
+ this.prompt,
+ );
+ // Immediately select "Unnamed" and move to Step 2
+ (this.$refs.customDialog as GiftedDialog).selectGiver();
+ } else {
+ (this.$refs.customDialog as GiftedDialog).open(
+ giver,
+ recipient,
+ undefined,
+ "Given by " + (giver?.name || "someone not named"),
+ this.prompt,
+ );
+ }
}
}
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 84ee6e30..7ffadae7 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -1412,17 +1412,33 @@ export default class HomeView extends Vue {
* @param giver Optional contact info for giver
* @param description Optional gift description
*/
- openDialog(giver?: GiverReceiverInputInfo, description?: string) {
- (this.$refs.customDialog as GiftedDialog).open(
- giver,
- {
- did: this.activeDid,
- name: "you",
- } as GiverReceiverInputInfo,
- undefined,
- "Given by " + (giver?.name || "someone not named"),
- description,
- );
+ openDialog(giver?: GiverReceiverInputInfo | "Unnamed", description?: string) {
+ if (giver === "Unnamed") {
+ // Special case: Pass undefined to trigger Step 1, but with "Unnamed" pre-selected
+ (this.$refs.customDialog as GiftedDialog).open(
+ undefined,
+ {
+ did: this.activeDid,
+ name: "you",
+ } as GiverReceiverInputInfo,
+ undefined,
+ "Given by Unnamed",
+ description,
+ );
+ // Immediately select "Unnamed" and move to Step 2
+ (this.$refs.customDialog as GiftedDialog).selectGiver();
+ } else {
+ (this.$refs.customDialog as GiftedDialog).open(
+ giver,
+ {
+ did: this.activeDid,
+ name: "you",
+ } as GiverReceiverInputInfo,
+ undefined,
+ "Given by " + (giver?.name || "someone not named"),
+ description,
+ );
+ }
}
/**
diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue
index 18fd8d35..136c7a15 100644
--- a/src/views/ProjectViewView.vue
+++ b/src/views/ProjectViewView.vue
@@ -1216,13 +1216,25 @@ export default class ProjectViewView extends Vue {
);
}
- openGiftDialogToProject(contact?: libsUtil.GiverReceiverInputInfo) {
- (this.$refs.giveDialogToThis as GiftedDialog).open(
- contact,
- undefined,
- undefined,
- (contact?.name || "Someone not named") + ` gave to this project`,
- );
+ openGiftDialogToProject(contact?: libsUtil.GiverReceiverInputInfo | "Unnamed") {
+ if (contact === "Unnamed") {
+ // Special case: Pass undefined to trigger Step 1, but with "Unnamed" pre-selected
+ (this.$refs.giveDialogToThis as GiftedDialog).open(
+ undefined,
+ undefined,
+ undefined,
+ "Given by Unnamed to this project",
+ );
+ // Immediately select "Unnamed" and move to Step 2
+ (this.$refs.giveDialogToThis as GiftedDialog).selectGiver();
+ } else {
+ (this.$refs.giveDialogToThis as GiftedDialog).open(
+ contact,
+ undefined,
+ undefined,
+ (contact?.name || "Someone not named") + ` gave to this project`,
+ );
+ }
}
openGiftDialogFromProject() {