44 utils ,
55 enhancedLocalStorage ,
66 PORTKEYAA ,
7+ OperationTypeEnum ,
78} from '@aelf-web-login/wallet-adapter-base' ;
89import { Bridge } from './bridge' ;
910import {
@@ -15,6 +16,9 @@ import {
1516 TelegramPlatform ,
1617 CreatePendingInfo ,
1718 setLoading ,
19+ GuardianApprovalModal ,
20+ getOperationDetails ,
21+ ConfigProvider ,
1822} from '@portkey/did-ui-react' ;
1923import '@portkey/did-ui-react/dist/assets/index.css' ;
2024import { IBaseConfig } from '.' ;
@@ -230,7 +234,16 @@ const SignInModal: React.FC<ISignInModalProps> = (props: ISignInModalProps) => {
230234 const [ isWrongPassword , setIsWrongPassword ] = useState ( false ) ;
231235 const [ isShowConfirmLogoutPanel , setIsShowConfirmLogoutPanel ] = useState ( false ) ;
232236 const [ isShowNestedModal , setIsShowNestedModal ] = useState ( false ) ;
233- const { handleTelegram, currentLifeCircle } = useTelegram (
237+ const {
238+ handleTelegram,
239+ currentLifeCircle,
240+ guardianList,
241+ approvalVisible,
242+ setApprovalVisible,
243+ caHash,
244+ originChainId,
245+ onTGSignInApprovalSuccess,
246+ } = useTelegram (
234247 baseConfig . enableAcceleration ,
235248 baseConfig . defaultPin ,
236249 baseConfig . chainId ,
@@ -282,10 +295,24 @@ const SignInModal: React.FC<ISignInModalProps> = (props: ISignInModalProps) => {
282295 }
283296 console . log ( 'begin to excute autoAuthInTelegram' ) ;
284297 if ( enhancedLocalStorage . getItem ( 'connectedWallet' ) === PORTKEYAA ) {
298+ ConfigProvider . setGlobalConfig ( {
299+ globalLoadingHandler : {
300+ onSetLoading : ( loadingInfo ) => {
301+ console . log ( loadingInfo , 'loadingInfo===' ) ;
302+ } ,
303+ } ,
304+ } ) ;
285305 await bridgeInstance . onPortkeyAAUnLock ( defaultPin ) ;
286306 return ;
287307 }
288308 if ( ! cancelAutoLoginInTelegram ) {
309+ ConfigProvider . setGlobalConfig ( {
310+ globalLoadingHandler : {
311+ onSetLoading : ( loadingInfo ) => {
312+ console . log ( loadingInfo , 'loadingInfo===' ) ;
313+ } ,
314+ } ,
315+ } ) ;
289316 console . log ( 'begin to excute handleTelegram' ) ;
290317 handleTelegram ( ) ;
291318 }
@@ -527,6 +554,23 @@ const SignInModal: React.FC<ISignInModalProps> = (props: ISignInModalProps) => {
527554 </ DynamicWrapper >
528555 ) }
529556
557+ { guardianList ?. length && (
558+ < GuardianApprovalModal
559+ open = { approvalVisible }
560+ isAsyncVerify
561+ networkType = { baseConfig . networkType }
562+ caHash = { caHash }
563+ originChainId = { originChainId }
564+ targetChainId = { baseConfig . chainId }
565+ guardianList = { guardianList }
566+ operationType = { OperationTypeEnum . communityRecovery }
567+ operationDetails = { getOperationDetails ( OperationTypeEnum . communityRecovery ) }
568+ onClose = { ( ) => setApprovalVisible ( false ) }
569+ onBack = { ( ) => setApprovalVisible ( false ) }
570+ onApprovalSuccess = { onTGSignInApprovalSuccess }
571+ />
572+ ) }
573+
530574 < FinalConfirmLogoutDialog
531575 visible = { isShowConfirmLogoutPanel }
532576 onOk = { confirmLogoutHandler }
0 commit comments