Skip to content

Commit 95a43a0

Browse files
committed
fix mobx sorting
1 parent 5fdcb5f commit 95a43a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/DonationPage/sections/MainComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
CharLimitTreshold,
1111
PaymentPageConfigContext,
1212
} from "../../../logic/PaymentPageConfig";
13+
import { toJS } from "mobx";
1314

1415
const MessageComponent = observer(({}) => {
1516
const payment = useContext(PaymentStoreContext);
@@ -28,7 +29,7 @@ const MessageComponent = observer(({}) => {
2829
const tresholds = pageConfig.charLimit.value as CharLimitTreshold[];
2930
console.log({tresholds: tresholds}, "finding limits");
3031
return (
31-
tresholds
32+
toJS(tresholds)
3233
.sort((a, b) => -(a.treshold - b.treshold))
3334
.find((value) => value.treshold <= payment.amount)?.limit ?? 300
3435
);

0 commit comments

Comments
 (0)