Skip to content

Commit

Permalink
fix amount multipliers
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 21, 2024
1 parent 5ba1d9f commit 7e6f188
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/components/PaymentRequestDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ export default defineComponent({
},
computed: {
...mapState(usePRStore, ["showPRKData"]),
...mapState(useMintsStore, ["activeMintUrl", "activeUnit"]),
...mapState(useMintsStore, [
"activeMintUrl",
"activeUnit",
"activeUnitCurrencyMultiplyer",
]),
...mapWritableState(usePRStore, ["showPRDialog"]),
},
methods: {
Expand Down Expand Up @@ -149,8 +153,11 @@ export default defineComponent({
this.paymentRequestAmount = undefined;
this.amountLabel = this.amountLabelDefault;
} else {
this.paymentRequestAmount = amount;
this.amountLabel = useUiStore().formatCurrency(amount, this.activeUnit);
this.paymentRequestAmount = amount * this.activeUnitCurrencyMultiplyer;
this.amountLabel = useUiStore().formatCurrency(
amount * this.activeUnitCurrencyMultiplyer,
this.activeUnit
);
}
this.newPaymentRequest(this.paymentRequestAmount);
this.isEditingAmount = false;
Expand Down
1 change: 1 addition & 0 deletions src/stores/nostr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export const useNostrStore = defineStore("nostr", {
return Math.floor(Date.now() / 1000) - Math.floor(Math.random() * 172800);
},
sendNip17DirectMessage: async function (recipient: string, message: string, relays?: string[]) {
await this.initWalletSeedPrivateKeySigner();
const randomPrivateKey = generateSecretKey();
const randomPublicKey = getPublicKey(randomPrivateKey);
const ndk = new NDK({ explicitRelayUrls: relays ?? this.relays, signer: new NDKPrivateKeySigner(bytesToHex(randomPrivateKey)) });
Expand Down
2 changes: 1 addition & 1 deletion src/stores/payment-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const usePRStore = defineStore("payment-request", {
}
// if the payment request has an amount, set it
if (request.amount) {
sendTokenStore.sendData.amount = request.amount;
sendTokenStore.sendData.amount = request.amount / mintsStore.activeUnitCurrencyMultiplyer;
}
sendTokenStore.sendData.paymentRequest = request;
if (!sendTokenStore.showSendTokens) {
Expand Down

0 comments on commit 7e6f188

Please sign in to comment.