diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue
index cb4d9f4..2ad08b0 100644
--- a/src/components/GiftedDialog.vue
+++ b/src/components/GiftedDialog.vue
@@ -2,7 +2,7 @@
- {{ customTitle || message + " " + giver?.name || "somebody not named" }}
+ {{ customTitle }}
void;
- @Prop message = "";
@Prop projectId = "";
activeDid = "";
@@ -337,7 +334,7 @@ export default class GiftedDialog extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Error with give recordation caught:", error);
- const message =
+ const errorMessage =
error.userMessage ||
error.response?.data?.error?.message ||
"There was an error recording the give.";
@@ -346,7 +343,7 @@ export default class GiftedDialog extends Vue {
group: "alert",
type: "danger",
title: "Error",
- text: message,
+ text: errorMessage,
},
-1,
);
diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts
index 5b0c881..a3b9c35 100644
--- a/src/libs/endorserServer.ts
+++ b/src/libs/endorserServer.ts
@@ -454,8 +454,8 @@ async function getHeaders(identity: IIdentifier | null) {
}
/**
- * @param handleId nullable -- which means that "undefined" will be returned
- * @param identity nullable -- which means no private info will be returned
+ * @param handleId nullable, in which case "undefined" will be returned
+ * @param identity nullable, in which case no private info will be returned
* @param axios
* @param apiServer
*/
@@ -464,7 +464,7 @@ export async function getPlanFromCache(
identity: IIdentifier | null,
axios: Axios,
apiServer: string,
-) {
+): Promise
{
if (!handleId) {
return undefined;
}
diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue
index a4290f9..066507e 100644
--- a/src/views/ClaimView.vue
+++ b/src/views/ClaimView.vue
@@ -146,7 +146,7 @@
-
+
Confirmations
@@ -782,6 +782,7 @@ export default class ClaimView extends Vue {
giver,
undefined,
this.veriClaim.handleId,
+ "Offer fulfilled by " + (giver?.name || "someone not named"),
);
}
diff --git a/src/views/ContactGiftingView.vue b/src/views/ContactGiftingView.vue
index 4f76741..ac83472 100644
--- a/src/views/ContactGiftingView.vue
+++ b/src/views/ContactGiftingView.vue
@@ -66,11 +66,7 @@
-
+
@@ -167,7 +163,12 @@ export default class ContactGiftingView extends Vue {
const recipient = this.projectId
? undefined
: { did: this.activeDid, name: "you" };
- (this.$refs.customDialog as GiftedDialog).open(giver, recipient);
+ (this.$refs.customDialog as GiftedDialog).open(
+ giver,
+ recipient,
+ undefined,
+ "Given by " + (giver?.name || "someone not named"),
+ );
}
}
diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue
index 511d22d..fb2fec4 100644
--- a/src/views/ContactsView.vue
+++ b/src/views/ContactsView.vue
@@ -1101,7 +1101,7 @@ export default class ContactsView extends Vue {
}
let callback: (amount: number) => void;
- let customTitle = "Given";
+ let customTitle = "";
// choose whether to open dialog to user or from user
if (giverDid == this.activeDid) {
callback = (amount: number) => {
@@ -1109,7 +1109,7 @@ export default class ContactsView extends Vue {
newList[recipientDid] = (newList[recipientDid] || 0) + amount;
this.givenByMeUnconfirmed = newList;
};
- customTitle = "To " + receiver.name;
+ customTitle = "Given to " + receiver.name;
} else {
// must be (recipientDid == this.activeDid)
callback = (amount: number) => {
@@ -1117,7 +1117,7 @@ export default class ContactsView extends Vue {
newList[giverDid] = (newList[giverDid] || 0) + amount;
this.givenToMeUnconfirmed = newList;
};
- customTitle = "From " + giver.name;
+ customTitle = "Received from " + giver.name;
}
(this.$refs.customGivenDialog as GiftedDialog).open(
giver,
diff --git a/src/views/GiftedDetails.vue b/src/views/GiftedDetails.vue
index bf31a79..5eabe11 100644
--- a/src/views/GiftedDetails.vue
+++ b/src/views/GiftedDetails.vue
@@ -18,12 +18,9 @@
What Was Given
- {{ customTitle || message + " " + giverName || "somebody not named" }}
-
-
From {{ giverName || "somebody not named" }}
to {{ recipientName || "somebody not named" }}
-
+
-
+
@@ -127,7 +124,7 @@ import QuickNav from "@/components/QuickNav.vue";
import TopMessage from "@/components/TopMessage.vue";
import { db } from "@/db/index";
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
-import { createAndSubmitGive } from "@/libs/endorserServer";
+import { createAndSubmitGive, getPlanFromCache } from "@/libs/endorserServer";
import * as libsUtil from "@/libs/util";
import { accessToken } from "@/libs/crypto";
import GiftedPhotoDialog from "@/components/GiftedPhotoDialog.vue";
@@ -146,7 +143,6 @@ export default class GiftedDetails extends Vue {
apiServer = "";
amountInput = "0";
- customTitle = "";
description = "";
givenToUser = false;
giverDid: string | undefined;
@@ -156,6 +152,7 @@ export default class GiftedDetails extends Vue {
message = "";
offerId = "";
projectId = "";
+ projectName = "a project";
recipientDid = "";
recipientName = "";
showGivenToUser = false;
@@ -165,7 +162,6 @@ export default class GiftedDetails extends Vue {
async mounted() {
this.amountInput = this.$route.query.amountInput as string;
- this.customTitle = this.$route.query.customTitle as string;
this.description = this.$route.query.description as string;
this.giverDid = this.$route.query.giverDid as string;
this.giverName = this.$route.query.giverName as string;
@@ -209,6 +205,21 @@ export default class GiftedDetails extends Vue {
-1,
);
}
+
+ if (this.projectId) {
+ console.log("Getting project name from cache", this.projectId);
+ const identity = await libsUtil.getIdentity(this.activeDid);
+ const project = await getPlanFromCache(
+ this.projectId,
+ identity,
+ this.axios,
+ this.apiServer,
+ );
+ console.log("Got project name from cache", project);
+ this.projectName = project?.name
+ ? "the project " + project.name
+ : "a project";
+ }
}
changeUnitCode() {
@@ -429,7 +440,7 @@ export default class GiftedDetails extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Error with give recordation caught:", error);
- const message =
+ const errorMessage =
error.userMessage ||
error.response?.data?.error?.message ||
"There was an error recording the give.";
@@ -438,7 +449,7 @@ export default class GiftedDetails extends Vue {
group: "alert",
type: "danger",
title: "Error",
- text: message,
+ text: errorMessage,
},
-1,
);
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index b6abb37..b2df336 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -168,7 +168,7 @@
-