Skip to content

Commit 46868cf

Browse files
committed
frontend: fix feetarget component always resetting to normal
Send to functional component refactoring introduced a bug that the FeeTarget component always resets to "Normal" fee after changing anything in the Send form.
1 parent dd304d3 commit 46868cf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

frontends/web/src/routes/account/send/feetargets.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Copyright 2018 Shift Devices AG
3-
* Copyright 2021-2024 Shift Crypto AG
3+
* Copyright 2021-2025 Shift Crypto AG
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -91,13 +91,16 @@ export const FeeTargets = ({
9191
});
9292
}
9393
setOptions(options);
94+
if (feeTarget) {
95+
return;
96+
}
9497
setFeeTarget(feeTargets.defaultFeeTarget);
9598
onFeeTargetChange(feeTargets.defaultFeeTarget);
9699
if (feeTargets.feeTargets.length === 0) {
97100
setNoFeeTargets(true);
98101
}
99102
focusInput();
100-
}, [t, feeTargets, focusInput, accountCode, config, onFeeTargetChange, disabled]);
103+
}, [t, feeTarget, feeTargets, focusInput, accountCode, config, onFeeTargetChange, disabled]);
101104

102105
const handleFeeTargetChange = (event: React.SyntheticEvent) => {
103106
const target = event.target as HTMLSelectElement;

0 commit comments

Comments
 (0)