Commit 77285dd 1 parent c6aa163 commit 77285dd Copy full SHA for 77285dd
File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,18 @@ function App() {
74
74
const cookie_accounts = Cookies . get ( 'client.accounts' ) || '{}' ;
75
75
const stored_accounts = JSON . parse ( localStorage . getItem ( 'clientAccounts' ) || '{}' ) ;
76
76
77
- Object . values ( JSON . parse ( cookie_accounts ) ) . forEach ( data => {
78
- const account_data = data as { loginid : string ; token : string } ;
79
- const loginid = account_data . loginid ;
80
- accounts_list [ loginid ] = account_data . token ;
81
- } ) ;
77
+ if ( Array . isArray ( cookie_accounts ) ) {
78
+ cookie_accounts . forEach ( data => {
79
+ const loginid = data . loginid ;
80
+ console . log ( 'loginid test' , data . loginid ) ;
81
+ accounts_list [ loginid ] = data . token ;
82
+ } ) ;
83
+
84
+ console . log ( 'loginid test cookie_accounts accounts_list' , cookie_accounts , accounts_list ) ;
85
+ localStorage . setItem ( 'accountsList' , accounts_list ) ;
86
+ } else {
87
+ console . error ( 'Invalid cookie_accounts format' ) ;
88
+ }
82
89
83
90
const client_accounts = {
84
91
...stored_accounts ,
You can’t perform that action at this time.
0 commit comments