File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/pages/DonationPage/sections Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {
10
10
CharLimitTreshold ,
11
11
PaymentPageConfigContext ,
12
12
} from "../../../logic/PaymentPageConfig" ;
13
- import { toJS } from "mobx" ;
13
+ import { reaction , toJS } from "mobx" ;
14
14
15
15
const MessageComponent = observer ( ( { } ) => {
16
16
const payment = useContext ( PaymentStoreContext ) ;
@@ -27,7 +27,7 @@ const MessageComponent = observer(({}) => {
27
27
return pageConfig . charLimit . value as number ;
28
28
}
29
29
const tresholds = pageConfig . charLimit . value as CharLimitTreshold [ ] ;
30
- console . log ( { tresholds : tresholds } , "finding limits" ) ;
30
+ console . log ( { tresholds : tresholds } , "finding limits" ) ;
31
31
return (
32
32
toJS ( tresholds )
33
33
. sort ( ( a , b ) => - ( a . treshold - b . treshold ) )
@@ -42,6 +42,13 @@ const MessageComponent = observer(({}) => {
42
42
payment . text = newValue ;
43
43
}
44
44
45
+ reaction (
46
+ ( ) => payment . amount ,
47
+ ( ) => {
48
+ setLimit ( calcCharLimit ( ) ) ;
49
+ } ,
50
+ ) ;
51
+
45
52
return (
46
53
< >
47
54
< div className = { `${ classes . section } ${ classes . messagesection } ` } >
You can’t perform that action at this time.
0 commit comments