Browse Source

Remove 'customTitle' variable

pull/158/head
Jose Olarte III 2 weeks ago
parent
commit
0582954cfa
  1. 3
      src/components/GiftedDialog.vue
  2. 1
      src/views/ClaimView.vue
  3. 4
      src/views/ContactGiftingView.vue
  4. 4
      src/views/ContactsView.vue
  5. 12
      src/views/HomeView.vue
  6. 4
      src/views/ProjectViewView.vue

3
src/components/GiftedDialog.vue

@ -122,7 +122,6 @@ export default class GiftedDialog extends Vue {
amountInput = "0"; amountInput = "0";
callbackOnSuccess?: (amount: number) => void = () => {}; callbackOnSuccess?: (amount: number) => void = () => {};
customTitle?: string;
description = ""; description = "";
firstStep = true; // true = Step 1 (giver/recipient selection), false = Step 2 (amount/description) firstStep = true; // true = Step 1 (giver/recipient selection), false = Step 2 (amount/description)
giver?: libsUtil.GiverReceiverInputInfo; // undefined means no identified giver agent giver?: libsUtil.GiverReceiverInputInfo; // undefined means no identified giver agent
@ -222,11 +221,9 @@ export default class GiftedDialog extends Vue {
giver?: libsUtil.GiverReceiverInputInfo, giver?: libsUtil.GiverReceiverInputInfo,
receiver?: libsUtil.GiverReceiverInputInfo, receiver?: libsUtil.GiverReceiverInputInfo,
offerId?: string, offerId?: string,
customTitle?: string,
prompt?: string, prompt?: string,
callbackOnSuccess: (amount: number) => void = () => {}, callbackOnSuccess: (amount: number) => void = () => {},
) { ) {
this.customTitle = customTitle;
this.giver = giver; this.giver = giver;
this.prompt = prompt || ""; this.prompt = prompt || "";
this.receiver = receiver; this.receiver = receiver;

1
src/views/ClaimView.vue

@ -1001,7 +1001,6 @@ export default class ClaimView extends Vue {
giver, giver,
undefined, undefined,
this.veriClaim.handleId, this.veriClaim.handleId,
"Offer fulfilled by " + (giver?.name || "someone not named"),
); );
} }

4
src/views/ContactGiftingView.vue

@ -225,7 +225,6 @@ export default class ContactGiftingView extends Vue {
giver, giver,
recipient, recipient,
undefined, undefined,
this.stepType === "giver" ? "Given by Unnamed" : "Given to Unnamed",
this.prompt, this.prompt,
); );
// Immediately select "Unnamed" and move to Step 2 // Immediately select "Unnamed" and move to Step 2
@ -276,9 +275,6 @@ export default class ContactGiftingView extends Vue {
giver, giver,
recipient, recipient,
undefined, undefined,
this.stepType === "giver"
? "Given by " + (contact?.name || "someone not named")
: "Given to " + (contact?.name || "someone not named"),
this.prompt, this.prompt,
); );
} }

4
src/views/ContactsView.vue

@ -1049,7 +1049,6 @@ export default class ContactsView extends Vue {
} }
let callback: (amount: number) => void; let callback: (amount: number) => void;
let customTitle = "";
// choose whether to open dialog to user or from user // choose whether to open dialog to user or from user
if (giverDid == this.activeDid) { if (giverDid == this.activeDid) {
callback = (amount: number) => { callback = (amount: number) => {
@ -1057,7 +1056,6 @@ export default class ContactsView extends Vue {
newList[recipientDid] = (newList[recipientDid] || 0) + amount; newList[recipientDid] = (newList[recipientDid] || 0) + amount;
this.givenByMeUnconfirmed = newList; this.givenByMeUnconfirmed = newList;
}; };
customTitle = "Given to " + (receiver?.name || "Someone Unnamed");
} else { } else {
// must be (recipientDid == this.activeDid) // must be (recipientDid == this.activeDid)
callback = (amount: number) => { callback = (amount: number) => {
@ -1065,13 +1063,11 @@ export default class ContactsView extends Vue {
newList[giverDid] = (newList[giverDid] || 0) + amount; newList[giverDid] = (newList[giverDid] || 0) + amount;
this.givenToMeUnconfirmed = newList; this.givenToMeUnconfirmed = newList;
}; };
customTitle = "Received from " + (giver?.name || "Someone Unnamed");
} }
(this.$refs.customGivenDialog as GiftedDialog).open( (this.$refs.customGivenDialog as GiftedDialog).open(
giver, giver,
receiver, receiver,
undefined as unknown as string, undefined as unknown as string,
customTitle,
undefined as unknown as string, undefined as unknown as string,
callback, callback,
); );

12
src/views/HomeView.vue

@ -1597,7 +1597,7 @@ export default class HomeView extends Vue {
* @param giver Optional contact info for giver * @param giver Optional contact info for giver
* @param description Optional gift description * @param description Optional gift description
*/ */
openDialog(giver?: GiverReceiverInputInfo | "Unnamed", description?: string) { openDialog(giver?: GiverReceiverInputInfo | "Unnamed", prompt?: string) {
if (giver === "Unnamed") { if (giver === "Unnamed") {
// Special case: Pass undefined to trigger Step 1, but with "Unnamed" pre-selected // Special case: Pass undefined to trigger Step 1, but with "Unnamed" pre-selected
(this.$refs.giftedDialog as GiftedDialog).open( (this.$refs.giftedDialog as GiftedDialog).open(
@ -1607,8 +1607,7 @@ export default class HomeView extends Vue {
name: "You", name: "You",
} as GiverReceiverInputInfo, } as GiverReceiverInputInfo,
undefined, undefined,
"Given by Unnamed", prompt,
description,
); );
// Immediately select "Unnamed" and move to Step 2 // Immediately select "Unnamed" and move to Step 2
(this.$refs.giftedDialog as GiftedDialog).selectGiver(); (this.$refs.giftedDialog as GiftedDialog).selectGiver();
@ -1620,8 +1619,7 @@ export default class HomeView extends Vue {
name: "You", name: "You",
} as GiverReceiverInputInfo, } as GiverReceiverInputInfo,
undefined, undefined,
"Given by " + (giver?.name || "someone not named"), prompt,
description,
); );
} }
} }
@ -1829,10 +1827,10 @@ export default class HomeView extends Vue {
openPersonDialog( openPersonDialog(
giver?: GiverReceiverInputInfo | "Unnamed", giver?: GiverReceiverInputInfo | "Unnamed",
description?: string, prompt?: string,
) { ) {
this.showProjectsDialog = false; this.showProjectsDialog = false;
this.openDialog(giver, description); this.openDialog(giver, prompt);
} }
openProjectDialog() { openProjectDialog() {

4
src/views/ProjectViewView.vue

@ -1155,7 +1155,6 @@ export default class ProjectViewView extends Vue {
undefined, undefined,
undefined, undefined,
undefined, undefined,
"Given by Unnamed to this project",
); );
// Immediately select "Unnamed" and move to Step 2 // Immediately select "Unnamed" and move to Step 2
(this.$refs.giveDialogToThis as GiftedDialog).selectGiver(); (this.$refs.giveDialogToThis as GiftedDialog).selectGiver();
@ -1173,7 +1172,6 @@ export default class ProjectViewView extends Vue {
image: this.imageUrl, image: this.imageUrl,
}, },
undefined, undefined,
`Given to ${this.name}`,
); );
} }
} }
@ -1189,7 +1187,6 @@ export default class ProjectViewView extends Vue {
}, },
{ did: this.activeDid, name: "You" }, { did: this.activeDid, name: "You" },
undefined, undefined,
`${this.name} gave to you`,
undefined, undefined,
undefined, undefined,
); );
@ -1239,7 +1236,6 @@ export default class ProjectViewView extends Vue {
giver, giver,
undefined, undefined,
offer.handleId, offer.handleId,
"Given by " + (giver?.name || "someone not named"),
); );
} }

Loading…
Cancel
Save