Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx committed May 17, 2024
1 parent bb93b08 commit 33cdd69
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class FirebaseTracking: TransformerTracker {

override public init() {
super.init()
FirebaseConfiguration.shared.setLoggerLevel(.max)
FirebaseConfiguration.shared.setLoggerLevel(.min)
Analytics.setUserProperty(String(format: "%.4f", UIDevice.current.systemVersionAsFloat), forName: "os_version")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ open class TrackingViewController: NavigableViewController {
navigationController?.navigationBar.setNeedsLayout()
}
}

override open func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
Tracking.shared?.leave(history?.path)
}

override open func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
Expand Down
11 changes: 1 addition & 10 deletions dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "975d00e29efb8d2ca017c5e61df90418ac01f7d7143e85a3f9ddb4eb982154e4",
"originHash" : "1c0055be4aba3ed4d97a2f62f05486877839310f65e2cbdd18b067bef06a04a3",
"pins" : [
{
"identity" : "bigint",
Expand Down Expand Up @@ -46,15 +46,6 @@
"revision" : "48134b5460435cc9d048223ad7560ee2e40f3d4a"
}
},
{
"identity" : "percy-xcui-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/percy/percy-xcui-swift",
"state" : {
"revision" : "a2e9a86dfc3f5b69ef53cbda28a0ea71098c9f77",
"version" : "1.0.0"
}
},
{
"identity" : "qrcode",
"kind" : "remoteSourceControl",
Expand Down
2 changes: 2 additions & 0 deletions dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import FirebaseAnalytics
//
// Events defined in the v4-web repo. Ideally, we should keep this in-sync with v4-web
//
// TODO: deprecate and replace with AnalyticsEventV2
public enum AnalyticsEvent: String {
// App
case networkStatus = "NetworkStatus"
Expand Down Expand Up @@ -67,6 +68,7 @@ public extension AnalyticsEventV2 {
}

public enum AnalyticsEventV2: TrackableEvent, CustomDebugStringConvertible {
// TODO: add and replace all events
case appStart
case navigatePage(screen: ScreenIdentifiable)
case deepLinkHandled(url: String, succeeded: Bool)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import PlatformUI
import Combine
import dydxStateManager
import Abacus
import dydxAnalytics

public class dydxMarketInfoViewBuilder: NSObject, ObjectBuilderProtocol {
public func build<T>() -> T? {
Expand All @@ -27,12 +26,9 @@ public class dydxMarketInfoViewBuilder: NSObject, ObjectBuilderProtocol {
}

private class dydxMarketInfoViewController: HostingViewController<PlatformView, dydxMarketInfoViewModel> {
private var selectedMarketId: String {
history?.params?["market"] as? String ?? dydxSelectedMarketsStore.shared.lastSelectedMarket
}

override public func arrive(to request: RoutingRequest?, animated: Bool) -> Bool {
if request?.path == "/trade" || request?.path == "/market", let presenter = presenter as? dydxMarketInfoViewPresenter {
let selectedMarketId = request?.params?["market"] as? String ?? dydxSelectedMarketsStore.shared.lastSelectedMarket
dydxSelectedMarketsStore.shared.lastSelectedMarket = selectedMarketId
presenter.marketId = selectedMarketId
if let sectionRaw = request?.params?["currentSection"] as? String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import dydxStateManager
import Combine
import Charts
import dydxFormatter
import dydxAnalytics

public class dydxMarketsViewBuilder: NSObject, ObjectBuilderProtocol {
public func build<T>() -> T? {
Expand All @@ -30,7 +29,7 @@ public class dydxMarketsViewBuilder: NSObject, ObjectBuilderProtocol {

private class dydxMarketsViewController: HostingViewController<PlatformView, dydxMarketsViewModel> {
override public func arrive(to request: RoutingRequest?, animated: Bool) -> Bool {
request?.path == "/markets"
request?.path == "/portfolio/overview" || request?.path == "/markets"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import PanModal
import Combine
import Abacus
import dydxFormatter
import dydxAnalytics

public class dydxTakeProfitStopLossViewBuilder: NSObject, ObjectBuilderProtocol {
public func build<T>() -> T? {
Expand All @@ -43,7 +42,6 @@ private protocol dydxTakeProfitStopLossViewPresenterProtocol: HostedViewPresente
}

private class dydxTakeProfitStopLossViewPresenter: HostedViewPresenter<dydxTakeProfitStopLossViewModel>, dydxTakeProfitStopLossViewPresenterProtocol {

fileprivate var marketId: String?
@SynchronizedLock private var pendingOrders: Int?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import UIToolkits
import PlatformRouting
import FloatingPanel
import Utilities
import dydxAnalytics

public struct HostingViewControllerConfiguration {
public init(ignoreSafeArea: Bool = true, fixedHeight: CGFloat? = nil, gradientTabbar: Bool = false, disableNavigationController: Bool = false) {
Expand Down
7 changes: 7 additions & 0 deletions dydxV4/dydxV4/_Configurations/dydxevents.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
"modalType":"EMAIL_NOTIFICATIONS"
}
},
"/markets":{
"event":"NavigatePage",
"info":{
"path":"/portfolio/overview",
"isInitialNavigatePage":false
}
},
"/my-profile":{
"event":"NavigatePage",
"info":{
Expand Down

0 comments on commit 33cdd69

Please sign in to comment.