Skip to content

Commit

Permalink
Merge branch 'feature/private_beta_feedback' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Apr 10, 2024
2 parents 3f6437f + d7d084a commit 68f4496
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions Kukai Mobile/Controls/ScanViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,22 @@ class ScanViewController: UIViewController, AVCaptureMetadataOutputObjectsDelega
if let metadataObject = metadataObjects.first {
guard let readableObject = metadataObject as? AVMetadataMachineReadableCodeObject else { return }
guard let stringValue = readableObject.stringValue else { return }
AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate))

if previousString != stringValue {
AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate))
previousString = stringValue
checkForBeaconAndReport(stringToCheck: stringValue)
}
}
}

private func checkForBeaconAndReport(stringToCheck: String) {
if let data = Base58Check.decode(stringToCheck), let json = try? JSONSerialization.jsonObject(with: data) as? [String: String], let _ = json["relayServer"], let _ = json["publicKey"] {

if stringToCheck.prefix(8) == "tezos://" {
self.windowError(withTitle: "error".localized(), description: "error-beacon-not-supported".localized())
self.textfield.text = ""

} else if let data = Base58Check.decode(stringToCheck), let json = try? JSONSerialization.jsonObject(with: data) as? [String: String], let _ = json["relayServer"], let _ = json["publicKey"] {
self.windowError(withTitle: "error".localized(), description: "error-beacon-not-supported".localized())
self.textfield.text = ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ extension DiscoverFeaturedCell: UICollectionViewDelegate, UICollectionViewDataSo
guard let c = cell as? DiscoverFeaturedItemCell else { return }

let item = discoverGroup.items[indexPath.row]
c.setupImage(imageURL: item.imageUri)
c.setupImage(imageURL: item.mobileCarouselUri)
}

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
Expand Down
4 changes: 2 additions & 2 deletions Kukai Mobile/Modules/Discover/Discover.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<rect key="frame" x="0.0" y="0.0" width="394" height="220"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kXi-RG-cXs">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kXi-RG-cXs">
<rect key="frame" x="0.0" y="0.0" width="394" height="150"/>
<color key="backgroundColor" name="BGThumbNFT"/>
<constraints>
Expand Down Expand Up @@ -337,7 +337,7 @@
</scenes>
<designables>
<designable name="uLl-Eg-mC4">
<size key="intrinsicContentSize" width="30" height="34"/>
<size key="intrinsicContentSize" width="26" height="26"/>
</designable>
</designables>
<resources>
Expand Down
1 change: 1 addition & 0 deletions Kukai Mobile/Services/DiscoverService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public struct DiscoverItem: Codable, Hashable, Identifiable {
public let description: String

@URLFromString public var imageUri: URL?
@URLFromString public var mobileCarouselUri: URL?
@URLFromString public var projectURL: URL?
}

Expand Down

0 comments on commit 68f4496

Please sign in to comment.