Skip to content

Commit

Permalink
- update to ReOwn branch to check if session deletion issue is solved
Browse files Browse the repository at this point in the history
- remove spinner on top right button as ReOwn now sits in a disconnected state unless there is an active session
  • Loading branch information
simonmcl committed Oct 29, 2024
1 parent a52ae48 commit 02634af
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Kukai Mobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,7 @@
CODE_SIGN_ENTITLEMENTS = "Kukai Mobile/Kukai Mobile.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 341;
CURRENT_PROJECT_VERSION = 342;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = TK7KK2VPJP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = TK7KK2VPJP;
Expand Down Expand Up @@ -2478,7 +2478,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 341;
CURRENT_PROJECT_VERSION = 342;
DEVELOPMENT_TEAM = TK7KK2VPJP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = TK7KK2VPJP;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2660,7 +2660,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 341;
CURRENT_PROJECT_VERSION = 342;
DEVELOPMENT_TEAM = TK7KK2VPJP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = TK7KK2VPJP;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2789,8 +2789,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/reown-com/reown-swift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.4;
branch = "chore/fix-session-deletion";
kind = branch;
};
};
C055EF1F2A2F95ED0031CB5F /* XCRemoteSwiftPackageReference "QRCode" */ = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "02ce2dee9e17e8594036233131a00605b3d9ef6e740f0cf68e3faa02ff90c7cb",
"originHash" : "0d18dce6a4b7a3b395728aab63bab5c0fe0fe3554008cf00a4d0f60083aae4dc",
"pins" : [
{
"identity" : "anycodable",
Expand Down Expand Up @@ -96,8 +96,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/reown-com/reown-swift",
"state" : {
"revision" : "8c1a43e28358a30dc03367dca2f38476f1573ece",
"version" : "1.0.4"
"branch" : "chore/fix-session-deletion",
"revision" : "71a24386e5cda525fe945b22d7ff6a952af4a810"
}
},
{
Expand Down
12 changes: 8 additions & 4 deletions Kukai Mobile/Modules/Home/HomeTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,13 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat
self?.refreshType = .refreshEverything
self?.refresh(addresses: nil)

/*
// When returning from a long background, WC2 can sometimes be stuck in a disconnected state.
// Give it a few seconds to try connect by itself, and then try manual intervention
DispatchQueue.main.asyncAfter(deadline: .now() + 3) { [weak self] in
self?.recheckWalletConnectAnimation(tryManualReconnect: true)
}
*/
}.store(in: &bag)

ThemeManager.shared.$themeDidChange
Expand Down Expand Up @@ -250,19 +252,20 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat
public override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

recheckWalletConnectAnimation()
//recheckWalletConnectAnimation()
}

// When returning from background, WC2 socket can get stuck sometimes.
// First we double check that no event was missed by running the logic again
// Second we have an optional request to attempt to reconnect the socket by re-initalising the WC2 singletons
public func recheckWalletConnectAnimation(tryManualReconnect: Bool = false) {
let isConnected = WalletConnectService.shared.isConnected
/*let isConnected = WalletConnectService.shared.isConnected
connectionStatusChanged(status: isConnected ? .connected : .disconnected)

if !isConnected && tryManualReconnect {
attemptWC2Reconnect()
}
*/
}

public override func viewDidLayoutSubviews() {
Expand Down Expand Up @@ -505,7 +508,7 @@ extension HomeTabBarController: ScanViewControllerDelegate {
extension HomeTabBarController: WalletConnectServiceDelegate {

public func connectionStatusChanged(status: SocketConnectionStatus) {
if status == .disconnected {
/*if status == .disconnected {

if walletConnectActivity.superview == nil {
self.walletConnectActivity.frame = self.scanButton.frame
Expand All @@ -523,10 +526,11 @@ extension HomeTabBarController: WalletConnectServiceDelegate {
self.walletConnectActivity.stopAnimating()
self.walletConnectActivity.removeFromSuperview()
}
*/
}

@objc private func attemptWC2Reconnect() {
WalletConnectService.shared.setup(force: true)
//WalletConnectService.shared.setup(force: true)
}

/*
Expand Down

0 comments on commit 02634af

Please sign in to comment.