@@ -84,6 +84,11 @@ private async void ConnectWallet(WalletOptions options)
8484 {
8585 // Connect the wallet
8686
87+ var internalWalletProvider = options . Provider == WalletProvider . MetaMaskWallet ? WalletProvider . WalletConnectWallet : options . Provider ;
88+ var currentPanel = WalletPanels . Find ( panel => panel . Identifier == internalWalletProvider . ToString ( ) ) ;
89+
90+ Log ( currentPanel . LogText , $ "Connecting...") ;
91+
8792 var wallet = await ThirdwebManager . Instance . ConnectWallet ( options ) ;
8893
8994 // Initialize the wallet panel
@@ -92,8 +97,6 @@ private async void ConnectWallet(WalletOptions options)
9297
9398 // Setup actions
9499
95- var internalWalletProvider = options . Provider == WalletProvider . MetaMaskWallet ? WalletProvider . WalletConnectWallet : options . Provider ;
96- var currentPanel = WalletPanels . Find ( panel => panel . Identifier == internalWalletProvider . ToString ( ) ) ;
97100 ClearLog ( currentPanel . LogText ) ;
98101 currentPanel . Panel . SetActive ( true ) ;
99102
@@ -121,6 +124,7 @@ private async void ConnectWallet(WalletOptions options)
121124 currentPanel . Action3Button . onClick . RemoveAllListeners ( ) ;
122125 currentPanel . Action3Button . onClick . AddListener ( async ( ) =>
123126 {
127+ LoadingLog ( currentPanel . LogText ) ;
124128 var balance = await wallet . GetBalance ( chainId : ActiveChainId ) ;
125129 var balanceEth = Utils . ToEth ( wei : balance . ToString ( ) , decimalsToDisplay : 4 , addCommas : true ) ;
126130 Log ( currentPanel . LogText , $ "Balance: { balanceEth } { _chainDetails . NativeCurrency . Symbol } ") ;
@@ -171,7 +175,7 @@ private void InitializeInAppWalletPanel()
171175 InitializeInAppWalletPanel_Phone ( ) ;
172176 } ) ;
173177
174- // Socials (Using Google Here)
178+ // Socials
175179 panel . Action3Button . onClick . RemoveAllListeners ( ) ;
176180 panel . Action3Button . onClick . AddListener ( ( ) =>
177181 {
@@ -256,6 +260,7 @@ private void InitializeInAppWalletPanel_Socials()
256260 {
257261 try
258262 {
263+ Log ( panel . LogText , "Authenticating..." ) ;
259264 var inAppWalletOptions = new InAppWalletOptions ( authprovider : AuthProvider . Google ) ;
260265 var options = new WalletOptions ( provider : WalletProvider . InAppWallet , chainId : ActiveChainId , inAppWalletOptions : inAppWalletOptions ) ;
261266 ConnectWallet ( options ) ;
@@ -271,6 +276,7 @@ private void InitializeInAppWalletPanel_Socials()
271276 {
272277 try
273278 {
279+ Log ( panel . LogText , "Authenticating..." ) ;
274280 var inAppWalletOptions = new InAppWalletOptions ( authprovider : AuthProvider . Apple ) ;
275281 var options = new WalletOptions ( provider : WalletProvider . InAppWallet , chainId : ActiveChainId , inAppWalletOptions : inAppWalletOptions ) ;
276282 ConnectWallet ( options ) ;
@@ -286,6 +292,7 @@ private void InitializeInAppWalletPanel_Socials()
286292 {
287293 try
288294 {
295+ Log ( panel . LogText , "Authenticating..." ) ;
289296 var inAppWalletOptions = new InAppWalletOptions ( authprovider : AuthProvider . Discord ) ;
290297 var options = new WalletOptions ( provider : WalletProvider . InAppWallet , chainId : ActiveChainId , inAppWalletOptions : inAppWalletOptions ) ;
291298 ConnectWallet ( options ) ;
@@ -318,6 +325,7 @@ private void InitializeContractsPanel()
318325 {
319326 try
320327 {
328+ LoadingLog ( panel . LogText ) ;
321329 var dropErc1155Contract = await ThirdwebManager . Instance . GetContract ( address : "0x6A7a26c9a595E6893C255C9dF0b593e77518e0c3" , chainId : ActiveChainId ) ;
322330 var nft = await dropErc1155Contract . ERC1155_GetNFT ( tokenId : 1 ) ;
323331 Log ( panel . LogText , $ "NFT: { JsonConvert . SerializeObject ( nft . Metadata ) } ") ;
@@ -334,6 +342,7 @@ private void InitializeContractsPanel()
334342 {
335343 try
336344 {
345+ LoadingLog ( panel . LogText ) ;
337346 var contract = await ThirdwebManager . Instance . GetContract ( address : "0x6A7a26c9a595E6893C255C9dF0b593e77518e0c3" , chainId : ActiveChainId ) ;
338347 var result = await contract . ERC1155_URI ( tokenId : 1 ) ;
339348 Log ( panel . LogText , $ "Result (uri): { result } ") ;
@@ -350,6 +359,7 @@ private void InitializeContractsPanel()
350359 {
351360 try
352361 {
362+ LoadingLog ( panel . LogText ) ;
353363 var dropErc20Contract = await ThirdwebManager . Instance . GetContract ( address : "0xEBB8a39D865465F289fa349A67B3391d8f910da9" , chainId : ActiveChainId ) ;
354364 var symbol = await dropErc20Contract . ERC20_Symbol ( ) ;
355365 var balance = await dropErc20Contract . ERC20_BalanceOf ( ownerAddress : await ThirdwebManager . Instance . GetActiveWallet ( ) . GetAddress ( ) ) ;
@@ -431,6 +441,7 @@ private async void InitializeAccountAbstractionPanel()
431441 {
432442 try
433443 {
444+ LoadingLog ( panel . LogText ) ;
434445 var activeSigners = await smartWallet . GetAllActiveSigners ( ) ;
435446 Log ( panel . LogText , $ "Active Signers: { JsonConvert . SerializeObject ( activeSigners ) } ") ;
436447 }
@@ -460,5 +471,10 @@ private void Log(TMP_Text logText, string message)
460471 logText . text = message ;
461472 ThirdwebDebug . Log ( message ) ;
462473 }
474+
475+ private void LoadingLog ( TMP_Text logText )
476+ {
477+ logText . text = "Loading..." ;
478+ }
463479 }
464480}
0 commit comments