Skip to content

Commit b878f2e

Browse files
committed
Merge branch 'develop'
2 parents 426321f + a6aa947 commit b878f2e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

apps/extension/src/stores/ui-config/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface UIConfigOptions {
3232
showFiatValue: boolean;
3333
showSearchBar: boolean;
3434
switchAssetViewModeSuggestion: boolean;
35+
switchAssetViewModeSuggestion2: boolean;
3536
isPrivacyMode: boolean;
3637
rememberLastFeeOption: boolean;
3738
lastFeeOption: "low" | "average" | "high" | false;
@@ -64,7 +65,9 @@ export class UIConfigStore {
6465
rememberLastFeeOption: false,
6566
lastFeeOption: false,
6667
show24HChangesInMagePage: true,
68+
// switchAssetViewModeSuggestion is deprecated to show the suggestion again
6769
switchAssetViewModeSuggestion: true,
70+
switchAssetViewModeSuggestion2: true,
6871

6972
useWebHIDLedger: false,
7073
};
@@ -270,12 +273,12 @@ export class UIConfigStore {
270273
}
271274

272275
get switchAssetViewModeSuggestion(): boolean {
273-
return this.options.switchAssetViewModeSuggestion;
276+
return this.options.switchAssetViewModeSuggestion2;
274277
}
275278

276279
@action
277280
turnOffSwitchAssetViewModeSuggestion() {
278-
this.options.switchAssetViewModeSuggestion = false;
281+
this.options.switchAssetViewModeSuggestion2 = false;
279282
}
280283

281284
get useWebHIDLedger(): boolean {

packages/hooks/src/tx/amount.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,13 @@ export class AmountConfig extends TxChainSetter implements IAmountConfig {
110110
const subFee = this.feeConfig.fees[0].mul(
111111
new Dec(this._fractionSubFeeWeight)
112112
);
113-
return maxValue.sub(subFee).toString();
113+
const finalValue = maxValue.sub(subFee);
114+
115+
if (finalValue.toDec().lte(new Dec(0))) {
116+
return "0";
117+
}
118+
119+
return finalValue.toString();
114120
}
115121

116122
return maxValue.toString();

0 commit comments

Comments
 (0)