Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix max button not updating currency in TransferMenu #421

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading