Skip to content

Commit

Permalink
Fix various bugs found through the QA process (#305)
Browse files Browse the repository at this point in the history
* Showing all time trading rewards

* Bump Abacus and fix the rewards learn more link

* Use non-staging version of Firebase config for TestFlight build (#302)

* Firebase initialization clean up (#303)

* BUG2-152 Fixing scroll back in time on price chart. (#304)

* BUG2-31 Fix rewards learn more

* BUG2-148 Trading rewards for the week, only appear after I view the trading rewards page.

* Fixing adjust target leverage receipt not updating

* Clean up
  • Loading branch information
ruixhuang authored Nov 25, 2024
1 parent aa3ff94 commit ea03bd9
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,11 @@ import FirebaseCore
import FirebaseCrashlytics
import Utilities

public final class FirebaseRunner: NSObject, SingletonProtocol {
public static var optionsFile: String? {
didSet {
guard oldValue != optionsFile else { return }
shared = .init(optionsFile: optionsFile)
}
}
public final class FirebaseRunner: NSObject {

public let enabled: Bool

public private(set) static var shared: FirebaseRunner = {
FirebaseRunner(optionsFile: optionsFile)
}()
public static var shared: FirebaseRunner?

public init(optionsFile: String?) {
if let optionsFile = optionsFile,
Expand All @@ -34,6 +27,7 @@ public final class FirebaseRunner: NSObject, SingletonProtocol {
FirebaseConfiguration.shared.setLoggerLevel(.min)
enabled = true
} else {
NSLog("Unable to initialize Firebase for options file: \(optionsFile ?? "")")
enabled = false
}
super.init()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class FirebaseNotificationHandler: NotificationHandler {
if token != oldValue {
updateAssociation()
if let token = token {
Console.shared.log("Firebase registration token: \(token)")
NSLog("Firebase registration token: \(token)")
}
switch Installation.source {
case .debug, .testFlight:
Expand All @@ -44,7 +44,6 @@ public class FirebaseNotificationHandler: NotificationHandler {
self.tag = tag
super.init()

_ = FirebaseRunner.shared
Messaging.messaging().delegate = self
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
self?.token = Messaging.messaging().fcmToken
Expand Down
15 changes: 8 additions & 7 deletions Shared/CommonAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,21 @@ open class CommonAppDelegate: ParticlesAppDelegate {

open func useProductionFirebase() -> Bool {
switch Installation.source {
case .debug, .testFlight, .jailBroken: return false
case .appStore: return true
case .debug, .jailBroken: return false
case .appStore, .testFlight: return true
}
}

open func injectFirebase() {
Console.shared.log("injectFirebase")
let optionsFile: String
if useProductionFirebase() {
FirebaseRunner.optionsFile = "GoogleService-Info"
optionsFile = "GoogleService-Info"
} else {
FirebaseRunner.optionsFile = "GoogleService-Info-Staging"
optionsFile = "GoogleService-Info-Staging"
}
_ = FirebaseRunner.shared
if FirebaseRunner.shared.enabled {
FirebaseRunner.shared = FirebaseRunner(optionsFile: optionsFile)
if FirebaseRunner.shared?.enabled ?? false {
add(tracking: FirebaseTracking())
add(errorLogging: CrashlyticsErrorLogging())
}
Expand Down Expand Up @@ -181,10 +182,10 @@ open class CommonAppDelegate: ParticlesAppDelegate {
}

override open func startup(completion: @escaping () -> Void) {
injectNotificationHandler()
injectURLHandler()
super.startup { [weak self] in
self?.injectNotification()
self?.injectNotificationHandler()
completion()
}
}
Expand Down
4 changes: 2 additions & 2 deletions dydx/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Abacus (1.13.32)
- Abacus (1.13.33)
- AmplitudeSwift (1.10.6):
- AnalyticsConnector (~> 1.0.1)
- AnalyticsConnector (1.0.3)
Expand Down Expand Up @@ -382,7 +382,7 @@ CHECKOUT OPTIONS:
:git: https://github.com/dydxprotocol/Charts.git

SPEC CHECKSUMS:
Abacus: 7dbb761660678bc7fce87674e112f7d69356a8d3
Abacus: bf913dcbe8c9aa6e4c0201c9874e31ddff38e0ea
AmplitudeSwift: 421c075d47e24bcf843024c853460f0769aeac2f
AnalyticsConnector: a53214d38ae22734c6266106c0492b37832633a9
AppsFlyerFramework: ad7ff0d22aa36c7f8cc4f71a5424e19b89ccb8ae
Expand Down
6 changes: 3 additions & 3 deletions dydx/Pods/Local Podspecs/abacus.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dydx/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 58 additions & 58 deletions dydx/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,11 @@ class dydxMarketPriceCandlesViewPresenter: HostedViewPresenter<dydxMarketPriceCa
CandleDataPoint(candle: candle, resolution: resolution.key)
}

listInteractor.list = [] // Needed to ensure the chart reloads properly
listInteractor.list = candleDataPoints
} else {
if listInteractor.list as? [CandleDataPoint] != candleDataPoints {
listInteractor.list = [] // Needed to ensure the chart reloads properly
listInteractor.list = candleDataPoints
}
} else {
listInteractor.list = []
}
}
Expand Down
Loading

0 comments on commit ea03bd9

Please sign in to comment.