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

web-wallet: Fix gas settings reset and validation in preferences #3213

Merged
merged 1 commit into from
Dec 18, 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
3 changes: 3 additions & 0 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fix gas settings reset and validation in preferences [#3212]

## [0.10.0] - 2024-12-17

### Added
Expand Down Expand Up @@ -455,6 +457,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#3178]: https://github.com/dusk-network/rusk/issues/3178
[#3179]: https://github.com/dusk-network/rusk/issues/3179
[#3203]: https://github.com/dusk-network/rusk/issues/3203
[#3212]: https://github.com/dusk-network/rusk/issues/3212

<!-- VERSIONS -->

Expand Down
3 changes: 2 additions & 1 deletion web-wallet/src/lib/components/BigIntInput/BigIntInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
/** @type {bigint} */
export let value = 0n;

let internalValue = value.toString();
/** @type {string} */
let internalValue;

/** @type {(v: bigint, min: bigint, max: bigint) => boolean} */
const isInvalidInput = (v, min, max) => !!(min > v || v > max);
Expand Down
13 changes: 6 additions & 7 deletions web-wallet/src/routes/(app)/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
// eslint-disable-next-line no-alert
if (confirm(confirmResetGasMessage)) {
settingsStore.resetGasSettings();
isGasValid = true;
}
}

Expand Down Expand Up @@ -88,13 +89,11 @@

isGasValid = areValidGasSettings(price, limit);

if (isGasValid) {
settingsStore.update((store) => ({
...store,
gasLimit: limit,
gasPrice: price,
}));
}
settingsStore.update((store) => ({
...store,
gasLimit: limit,
gasPrice: price,
}));
}}
limit={gasLimit}
limitLower={gasLimitLower}
Expand Down
Loading