Commit 91d8afb 1 parent c6bf825 commit 91d8afb Copy full SHA for 91d8afb
File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { useCallback } from 'react' ;
2
2
import { useFetch , useInvalidateQuery , useRequest } from '@deriv/api' ;
3
- import { useStore } from '@deriv/stores ' ;
3
+ import useAuthorize from './useAuthorize ' ;
4
4
5
5
/** A custom hook to get the status of wallet_migration API and to start/reset the migration process
6
6
* @deprecated This hook is deprecated. Please use the hook from @deriv/api instead.
7
7
*/
8
8
const useWalletMigration = ( ) => {
9
- // TODO: delete it later, it's a temporary solution
10
- // because we have to check for authorize from client store before doing API call
11
- // This hook will be refactored later for subscribe when BE is ready
12
- const { client } = useStore ( ) ;
13
- const { is_authorize } = client ;
9
+ const { isSuccess } = useAuthorize ( ) ;
14
10
15
11
const invalidate = useInvalidateQuery ( ) ;
16
12
@@ -22,7 +18,7 @@ const useWalletMigration = () => {
22
18
payload : { wallet_migration : 'state' } ,
23
19
options : {
24
20
refetchInterval : response => ( response ?. wallet_migration ?. state === 'in_progress' ? 500 : false ) ,
25
- enabled : is_authorize ,
21
+ enabled : isSuccess ,
26
22
} ,
27
23
} ) ;
28
24
You can’t perform that action at this time.
0 commit comments