Skip to content

Commit

Permalink
Fix max button not updating currency in TransferMenu (#421)
Browse files Browse the repository at this point in the history
* Fix max button not updating currency in TransferMenu

* Add @input for tests

* Fix color not working
  • Loading branch information
Duddino authored Oct 10, 2024
1 parent ccb90c5 commit 37299ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion scripts/dashboard/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async function send(address, amount, useShieldInputs) {
*/
function getMaxBalance(useShieldInputs) {
const coinSatoshi = useShieldInputs ? wallet.shieldBalance : wallet.balance;
transferAmount.value = (coinSatoshi / COIN).toString();
transferAmount.value = coinSatoshi / COIN;
}
async function importFromDatabase() {
Expand Down
26 changes: 11 additions & 15 deletions scripts/dashboard/TransferMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,20 @@ const props = defineProps({
publicMode: Boolean,
});
const address = computed({
get() {
return props.address;
},
set(value) {
emit('update:address', value);
getAddressColor(value).then((c) => (color.value = c));
},
});
const amount = computed({
get() {
return props.amount;
},
const address = defineModel('address');
watch(address, (value) =>
getAddressColor(value).then((c) => (color.value = `${c} !important`))
);
const amount = defineModel('amount', {
set(value) {
emit('update:amount', value.toString());
return value.toString();
},
});
watch(amount, () => syncAmountCurrency());
function send() {
// TODO: Maybe in the future do one of those cool animation that set the
// Input red
Expand Down Expand Up @@ -149,7 +145,7 @@ async function selectContact() {
autocomplete="nope"
onkeydown="javascript: return event.keyCode == 69 ? false : true"
data-testid="amount"
@input="$nextTick(syncAmountCurrency)"
@input="syncAmountCurrency"
v-model="amount"
/>
<div class="input-group-append">
Expand Down

0 comments on commit 37299ca

Please sign in to comment.