diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue index cd70fd78..df7e8523 100644 --- a/src/components/GiftedDialog.vue +++ b/src/components/GiftedDialog.vue @@ -81,6 +81,12 @@ import GiftDetailsStep from "../components/GiftDetailsStep.vue"; import { PlanData } from "../interfaces/records"; import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin"; import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify"; +import { + NOTIFY_GIFT_ERROR_NEGATIVE_AMOUNT, + NOTIFY_GIFT_ERROR_NO_DESCRIPTION, + NOTIFY_GIFTED_DETAILS_NO_IDENTIFIER, + NOTIFY_GIFTED_DETAILS_RECORDING_GIVE, +} from "@/constants/notifications"; @Component({ components: { @@ -288,23 +294,24 @@ export default class GiftedDialog extends Vue { async confirm() { if (!this.activeDid) { this.safeNotify.error( - "You must select an identifier before you can record a give.", - TIMEOUTS.STANDARD, + NOTIFY_GIFTED_DETAILS_NO_IDENTIFIER.message, + TIMEOUTS.SHORT, ); return; } if (parseFloat(this.amountInput) < 0) { this.safeNotify.error( - "You may not send a negative number.", + NOTIFY_GIFT_ERROR_NEGATIVE_AMOUNT.message, TIMEOUTS.SHORT, ); return; } if (!this.description && !parseFloat(this.amountInput)) { this.safeNotify.error( - `You must enter a description or some number of ${ - this.libsUtil.UNIT_LONG[this.unitCode] - }.`, + NOTIFY_GIFT_ERROR_NO_DESCRIPTION.message.replace( + "{unit}", + this.libsUtil.UNIT_SHORT[this.unitCode] || this.unitCode, + ), TIMEOUTS.SHORT, ); return; @@ -320,7 +327,11 @@ export default class GiftedDialog extends Vue { } this.close(); - this.safeNotify.toast("Recording the give...", undefined, TIMEOUTS.BRIEF); + this.safeNotify.toast( + NOTIFY_GIFTED_DETAILS_RECORDING_GIVE.message, + undefined, + TIMEOUTS.BRIEF, + ); // this is asynchronous, but we don't need to wait for it to complete await this.recordGive( (this.giver?.did as string) || null, diff --git a/src/views/GiftedDetailsView.vue b/src/views/GiftedDetailsView.vue index ede96ef8..ef5be5e9 100644 --- a/src/views/GiftedDetailsView.vue +++ b/src/views/GiftedDetailsView.vue @@ -48,24 +48,12 @@ placeholder="What was received" />
- - -