@@ -34,8 +34,6 @@ import { useInitCache } from "@/nanoeffects/Init.ts";
34
34
import { $currentUser } from "@/stores/users.ts" ;
35
35
import { $currentNode } from "@/stores/node.ts" ;
36
36
37
- import { $globalParamsCacheBTS , $globalParamsCacheTEST } from "@/stores/cache.ts" ;
38
-
39
37
import { humanReadableFloat } from "@/lib/common" ;
40
38
41
39
import { createObjectStore } from "@/nanoeffects/Objects.ts" ;
@@ -49,32 +47,24 @@ export default function AccountLists(properties) {
49
47
const { t, i18n } = useTranslation ( locale . get ( ) , { i18n : i18nInstance } ) ;
50
48
const currentNode = useStore ( $currentNode ) ;
51
49
52
- const [ showDialog , setShowDialog ] = useState ( false ) ;
50
+ const {
51
+ _globalParamsBTS,
52
+ _globalParamsTEST
53
+ } = properties ;
53
54
55
+ const [ showDialog , setShowDialog ] = useState ( false ) ;
54
56
const [ targetUser , setTargetUser ] = useState ( ) ;
55
57
56
58
const usr = useSyncExternalStore ( $currentUser . subscribe , $currentUser . get , ( ) => true ) ;
57
59
58
- const _globalParamsBTS = useSyncExternalStore (
59
- $globalParamsCacheBTS . subscribe ,
60
- $globalParamsCacheBTS . get ,
61
- ( ) => true
62
- ) ;
63
-
64
- const _globalParamsTEST = useSyncExternalStore (
65
- $globalParamsCacheTEST . subscribe ,
66
- $globalParamsCacheTEST . get ,
67
- ( ) => true
68
- ) ;
69
-
70
60
const _chain = useMemo ( ( ) => {
71
61
if ( usr && usr . chain ) {
72
62
return usr . chain ;
73
63
}
74
64
return "bitshares" ;
75
65
} , [ usr ] ) ;
76
66
77
- useInitCache ( _chain ?? "bitshares" , [ "globalParams" ] ) ;
67
+ useInitCache ( _chain ?? "bitshares" , [ ] ) ;
78
68
79
69
const globalParams = useMemo ( ( ) => {
80
70
if ( _chain && ( _globalParamsBTS || _globalParamsTEST ) ) {
@@ -86,8 +76,8 @@ export default function AccountLists(properties) {
86
76
const [ fee , setFee ] = useState ( 0 ) ;
87
77
useEffect ( ( ) => {
88
78
if ( globalParams && globalParams . length ) {
89
- const foundFee = globalParams . find ( ( x ) => x [ 0 ] === 7 ) ; // operation: account_whitelist
90
- const finalFee = humanReadableFloat ( foundFee [ 1 ] . fee , 5 ) ;
79
+ const foundFee = globalParams . find ( ( x ) => x . id === 7 ) ; // operation: account_whitelist
80
+ const finalFee = humanReadableFloat ( foundFee . data . fee , 5 ) ;
91
81
setFee ( finalFee ) ;
92
82
}
93
83
} , [ globalParams ] ) ;
0 commit comments