Skip to content

Commit

Permalink
bugfix of SyncProgress crash
Browse files Browse the repository at this point in the history
https://console.firebase.google.com/project/litewallet-beta/crashlytics/app/ios:com.litecoin.loafwallet/issues/fecabb7c7120dca59920bd7a1918c710?time=last-seven-days&types=crash&sessionEventKey=040a831703ba417ab9c755d44759ced2_1949520751979676838
- Removed Unstoppable code
- Uncommented out Bitrefill
- added more branding
- Need to redesign Moonpay for Apple meeting
- Added labels

Signed-off-by: kcw-grunt <[email protected]>

Further polishing the new buy view

- rebuilt moonpay view
- removed unused logos
- added paste button
- improved layout
- Added non-buy country tabBar ViewController
- Fixed the region filter to change tabbar for unsupported countries
- Added unsupported event for Firebase
- Reset sync params to original value

Signed-off-by: kcw-grunt <[email protected]>

Refactored code

Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt committed May 31, 2024
1 parent 0c57f0b commit b282cae
Show file tree
Hide file tree
Showing 50 changed files with 1,289 additions and 998 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ litewallet-partner-api-ios
/partner-keys.plist
partner-keys.plist
GoogleService-Info.plist
*.gpx
19 changes: 19 additions & 0 deletions Dakar, Senegal.gpx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.topografix.com/GPX/gpx_style/0/2 http://www.topografix.com/GPX/gpx_style/0/2/gpx_style.xsd" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpx_style="http://www.topografix.com/GPX/gpx_style/0/2" version="1.1" creator="https://gpx.studio">
<metadata>
<name>new</name>
<author>
<name>gpx.studio</name>
<link href="https://gpx.studio"></link>
</author>
</metadata>
<trk>
<name>new</name>
<type>Cycling</type>
<trkseg>
<trkpt lat="14.737937563639399" lon="-17.483073867161895">
<ele>23.1</ele>
</trkpt>
</trkseg>
</trk>
</gpx>
113 changes: 50 additions & 63 deletions litewallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

51 changes: 0 additions & 51 deletions litewallet/AlertFailureView.swift

This file was deleted.

40 changes: 40 additions & 0 deletions litewallet/ApplicationController.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BackgroundTasks
import StoreKit
import SwiftUI
import UIKit

let timeSinceLastExitKey = "TimeSinceLastExit"
Expand Down Expand Up @@ -73,6 +74,8 @@ class ApplicationController: Subscriber, Trackable {
}

private func setup() {
setupDefaults()
countLaunches()
setupRootViewController()
window?.makeKeyAndVisible()
offMainInitialization()
Expand Down Expand Up @@ -316,3 +319,40 @@ class ApplicationController: Subscriber, Trackable {
}
}
}

extension ApplicationController {
func setupDefaults() {
if UserDefaults.standard.object(forKey: shouldRequireLoginTimeoutKey) == nil {
UserDefaults.standard.set(60.0 * 3.0, forKey: shouldRequireLoginTimeoutKey) // Default 3 min timeout
}
if UserDefaults.standard.object(forKey: hasSeenAnnounceView) == nil {
UserDefaults.standard.set(false, forKey: hasSeenAnnounceView) // Hasnt seen the Announce View
}
}

func countLaunches() {
if var launchNumber = UserDefaults.standard.object(forKey: numberOfLitewalletLaunches) as? Int {
launchNumber += 1
UserDefaults.standard.set(NSNumber(value: launchNumber), forKey: numberOfLitewalletLaunches)
if launchNumber == 5 {
if #available(iOS 14, *) {
if self.window != nil,
let scene = self.window?.windowScene
{
SKStoreReviewController.requestReview(in: scene)
}

} else {
SKStoreReviewController.requestReview()
}

LWAnalytics.logEventWithParameters(itemName: ._20200125_DSRR)
}
} else {
UserDefaults.standard.set(NSNumber(value: 1), forKey: numberOfLitewalletLaunches)
}
}

func willResignActive()
{}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"images" : [
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ud-Logo-Full-Light@3x.png",
"filename" : "moonpay-white.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 1 addition & 6 deletions litewallet/BartyCrouch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@ import Foundation
enum BartyCrouch {
enum SupportedLanguage: String {
// TODO: remove unsupported languages from the following cases list & add any missing languages
case arabic = "ar"
case chineseSimplified = "zh-Hans"
case chineseTraditional = "zh-Hant"
case english = "en"
case french = "fr"
case german = "de"
case hindi = "hi"
case indonesian = "id"
case italian = "it"
case japanese = "ja"
case korean = "ko"
case malay = "ms"
case portuguese = "pt"
case russian = "ru"
case spanish = "es"
case danish = "da"
case dutch = "nl"
case swedish = "sv"
case turkey = "tr"
case ukrainian = "uk"
}

static func translate(key: String, translations: [SupportedLanguage: String], comment _: String? = nil) -> String {
Expand Down
51 changes: 51 additions & 0 deletions litewallet/BuyHostingController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Foundation
import SwiftUI

/// Moonpay: List supported countries endpoint
/// https://api.moonpay.com/v3/countries
/// - Parameter alphaCode2Char: String
/// - Parameter alphaCode3Char: String
/// - Parameter isBuyAllowed: Bool
/// - Parameter isSellAllowed: Bool
/// - Parameter countryName: String (name)
/// - Parameter isAllowedInCountry: Bool (isAllowed)
/// ===================================
/// Unused JSON parameters
/// "isNftAllowed": false
/// "isBalanceLedgerWithdrawAllowed": true,
/// "isSelfServeHighRisk": true,
/// "continent": "Asia",
/// "supportedDocuments": [
/// "passport",
/// "driving_licence",
/// "national_identity_card",
/// "residence_permit",
/// ],
/// "suggestedDocument": "national_identity_card"
/// - Returns: MoonpayCountryData
public struct MoonpayCountryData: Codable, Hashable {
var alphaCode2Char: String
var alphaCode3Char: String
var isBuyAllowed: Bool
var isSellAllowed: Bool
var countryName: String
var isAllowedInCountry: Bool
}

class BuyHostingController: UIHostingController<BuyView> {
var contentView: BuyView

var isLoaded: Bool = false

init() {
let buyViewModel = BuyViewModel()
contentView = BuyView(viewModel: buyViewModel)

super.init(rootView: contentView)
}

@available(*, unavailable)
@MainActor dynamic required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
96 changes: 0 additions & 96 deletions litewallet/BuyTableViewController.swift

This file was deleted.

Loading

0 comments on commit b282cae

Please sign in to comment.