From adee193d9d8c5f661f31b959f9e6801345bc56d0 Mon Sep 17 00:00:00 2001 From: Simon McLoughlin Date: Fri, 26 Jan 2024 16:43:21 +0000 Subject: [PATCH 1/3] - add error display to when we auto reject operations because of another operation in progress --- Kukai Mobile/Localization/en.lproj/Localizable.strings | 1 + Kukai Mobile/Modules/Home/HomeTabBarController.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/Kukai Mobile/Localization/en.lproj/Localizable.strings b/Kukai Mobile/Localization/en.lproj/Localizable.strings index ddb26d03..5d8c0946 100644 --- a/Kukai Mobile/Localization/en.lproj/Localizable.strings +++ b/Kukai Mobile/Localization/en.lproj/Localizable.strings @@ -54,3 +54,4 @@ "error-beacon-not-supported"="Beacon QRCodes are not supported, only Wallet Connect. Please make sure you are using the kukai option. If you are, please contact the dApp support team and ask them to update their beacon version"; "error-collectible-media-generic"="Unable to play media at this time, please try again later"; "error-onramp-generic"="Unable to access this provider at this time, please try again later"; +"error-wc2-cant-open-more-modals"="An incoming wallet connect request was automatically rejected, as you are in the middle of an activity. Please return to one of the main tabs and try again."; diff --git a/Kukai Mobile/Modules/Home/HomeTabBarController.swift b/Kukai Mobile/Modules/Home/HomeTabBarController.swift index 2bf2c3a7..509405b3 100644 --- a/Kukai Mobile/Modules/Home/HomeTabBarController.swift +++ b/Kukai Mobile/Modules/Home/HomeTabBarController.swift @@ -512,6 +512,7 @@ extension HomeTabBarController: WalletConnectServiceDelegate { } } else { WalletConnectService.rejectCurrentRequest(completion: nil) + self.windowError(withTitle: "error".localized(), description: "error-wc2-cant-open-more-modals".localized()) } } From cde6a33bedb87c91ba66a911dc165fbbe7039bc1 Mon Sep 17 00:00:00 2001 From: Simon McLoughlin Date: Mon, 29 Jan 2024 11:38:51 +0000 Subject: [PATCH 2/3] - fix heavy animated image loading --- .../xcshareddata/swiftpm/Package.resolved | 2 +- .../Detail/CollectibleDetailImageCell.swift | 29 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 8e6aeb1a..20a35227 100644 --- a/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -69,7 +69,7 @@ "location" : "https://github.com/kukai-wallet/kukai-core-swift", "state" : { "branch" : "develop", - "revision" : "102e4e263710946b67e3fc403125b7d2f585a179" + "revision" : "b6df6e2744c40ce32760c454f32b391bf84d86af" } }, { diff --git a/Kukai Mobile/Modules/Collectibles/Cells/Detail/CollectibleDetailImageCell.swift b/Kukai Mobile/Modules/Collectibles/Cells/Detail/CollectibleDetailImageCell.swift index 40bcb0fd..a102b684 100644 --- a/Kukai Mobile/Modules/Collectibles/Cells/Detail/CollectibleDetailImageCell.swift +++ b/Kukai Mobile/Modules/Collectibles/Cells/Detail/CollectibleDetailImageCell.swift @@ -18,16 +18,6 @@ class CollectibleDetailImageCell: UICollectionViewCell { public var setup = false func setup(mediaContent: MediaContent, layoutOnly: Bool) { - activityIndicator.isHidden = true - - - /* - if mediaContent.isThumbnail { - activityIndicator.startAnimating() - } else { - activityIndicator.isHidden = true - } - */ // If landscape image, remove the existing square image constraint and repalce with smaller height aspect ratio image if mediaContent.width > mediaContent.height { @@ -38,8 +28,23 @@ class CollectibleDetailImageCell: UICollectionViewCell { // Load image if not only perfroming collectionview layout logic if !layoutOnly { - let maxSize: UInt = 1000000000 // 1000 - MediaProxyService.load(url: mediaContent.mediaURL, to: imageView, withCacheType: mediaContent.isThumbnail ? .temporary : .detail, fallback: UIImage.unknownThumb(), maxAnimatedImageSize: maxSize) + + // If its thumbnail, we don't want it to start animating and then jump back to the start in higher quality + // Set the thumbnail limit to bare minimum so it only loads the first frame, then loads the real image later + let maxSize: UInt = mediaContent.isThumbnail ? 1 : 1000000000 + MediaProxyService.load(url: mediaContent.mediaURL, to: imageView, withCacheType: .temporary, fallback: UIImage.unknownThumb(), maxAnimatedImageSize: maxSize) { [weak self] _ in + + // When imageView is empty, SDImageCache will display its own activity, but not when its filled + // So when we load thumbnail, we have to add our own to display so users know the full is laoding in + if mediaContent.isThumbnail { + self?.activityIndicator.isHidden = false + self?.activityIndicator.startAnimating() + + } else { + self?.activityIndicator.stopAnimating() + self?.activityIndicator.isHidden = true + } + } } setup = true From 8724045e4e2cb7bc5c2f3042d31c11caae327b25 Mon Sep 17 00:00:00 2001 From: Simon McLoughlin Date: Mon, 29 Jan 2024 15:19:45 +0000 Subject: [PATCH 3/3] - try simulate_operation instead of run_operation --- Kukai Mobile.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Kukai Mobile.xcodeproj/project.pbxproj b/Kukai Mobile.xcodeproj/project.pbxproj index 995ee4b6..f1c7c0fe 100644 --- a/Kukai Mobile.xcodeproj/project.pbxproj +++ b/Kukai Mobile.xcodeproj/project.pbxproj @@ -2707,7 +2707,7 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/kukai-wallet/kukai-core-swift"; requirement = { - branch = develop; + branch = feature/simulate_operation; kind = branch; }; }; diff --git a/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 20a35227..72e9f270 100644 --- a/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -68,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/kukai-wallet/kukai-core-swift", "state" : { - "branch" : "develop", - "revision" : "b6df6e2744c40ce32760c454f32b391bf84d86af" + "branch" : "feature/simulate_operation", + "revision" : "4913964dbb31cc37c3e70e5c4b5cb8f7846b1a58" } }, {