add 'offer' on contact screen

This commit is contained in:
2024-04-21 07:38:59 -06:00
parent 7cbdc7a099
commit ef95708d02
4 changed files with 32 additions and 9 deletions

View File

@@ -81,8 +81,7 @@ import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
export default class OfferDialog extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@Prop message = "";
@Prop projectId = "";
@Prop projectId? = "";
activeDid = "";
apiServer = "";
@@ -91,16 +90,20 @@ export default class OfferDialog extends Vue {
amountUnitCode = "HUR";
description = "";
expirationDateInput = "";
recipientDid? = "";
visible = false;
libsUtil = libsUtil;
async open() {
async open(recipientDid?: string) {
try {
this.recipientDid = recipientDid;
await db.open();
const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings;
this.apiServer = settings?.apiServer || "";
this.activeDid = settings?.activeDid || "";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
console.error("Error retrieving settings from database:", err);
@@ -222,6 +225,7 @@ export default class OfferDialog extends Vue {
amount,
unitCode,
expirationDateInput,
this.recipientDid,
this.projectId,
);