From e9235b2effc6c32d20cf0ead80b281e6cdabf5ce Mon Sep 17 00:00:00 2001 From: Yermek Garifullanov Date: Thu, 19 Dec 2024 11:50:33 +1300 Subject: [PATCH] chore: removed redundant code --- .../Immutable/Transak/TransakWebBrowser.cpp | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Source/Immutable/Private/Immutable/Transak/TransakWebBrowser.cpp b/Source/Immutable/Private/Immutable/Transak/TransakWebBrowser.cpp index f7f96e2..1f2d148 100644 --- a/Source/Immutable/Private/Immutable/Transak/TransakWebBrowser.cpp +++ b/Source/Immutable/Private/Immutable/Transak/TransakWebBrowser.cpp @@ -28,25 +28,11 @@ void UTransakWebBrowser::Load(const FString& WalletAddress, const FString& Email } FString UrlToLoad = ComputePath(WalletAddress, Email, ProductsAvailed, ScreenTitle); - - if (bIsReady) + FDelegateHandle OnWhenReadyHandle = CallAndRegister_OnWhenReady(UTransakWebBrowser::FOnWhenReady::FDelegate::CreateWeakLambda(this, [this, UrlToLoad, OnWhenReadyHandle]() { -#if (ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1) WebBrowserWidget->LoadURL(UrlToLoad); -#endif - } - else - { - FDelegateHandle OnWhenReadyHandle = CallAndRegister_OnWhenReady(UTransakWebBrowser::FOnWhenReady::FDelegate::CreateWeakLambda(this, [this, UrlToLoad, OnWhenReadyHandle]() - { -#if (ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1) - WebBrowserWidget->LoadURL(UrlToLoad); -#else - WebBrowserWidget->LoadURL(UrlToLoad); -#endif - OnWhenReady.Remove(OnWhenReadyHandle); - })); - } + OnWhenReady.Remove(OnWhenReadyHandle); + })); } FDelegateHandle UTransakWebBrowser::CallAndRegister_OnWhenReady(FOnWhenReady::FDelegate Delegate)