From b04643f5b6e1fb455a753c334cae0b86ed885e5f Mon Sep 17 00:00:00 2001 From: mike-dydx Date: Fri, 17 May 2024 14:27:29 -0400 Subject: [PATCH] clean up --- .../_Tracking/FirebaseTracking.swift | 2 +- .../_ViewController/TrackingViewController.swift | 5 +++++ .../xcshareddata/swiftpm/Package.resolved | 11 +---------- dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift | 2 ++ .../_v4/MarketInfo/dydxMarketInfoViewBuilder.swift | 6 +----- .../_v4/Markets/dydxMarketsViewBuilder.swift | 3 +-- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/FirebaseStaticInjections/FirebaseStaticInjections/_Tracking/FirebaseTracking.swift b/FirebaseStaticInjections/FirebaseStaticInjections/_Tracking/FirebaseTracking.swift index 3b3bbb1fa..220133d5c 100644 --- a/FirebaseStaticInjections/FirebaseStaticInjections/_Tracking/FirebaseTracking.swift +++ b/FirebaseStaticInjections/FirebaseStaticInjections/_Tracking/FirebaseTracking.swift @@ -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") } diff --git a/PlatformParticles/PlatformParticles/_ViewController/TrackingViewController.swift b/PlatformParticles/PlatformParticles/_ViewController/TrackingViewController.swift index b0a38dd0a..2fddb2a58 100644 --- a/PlatformParticles/PlatformParticles/_ViewController/TrackingViewController.swift +++ b/PlatformParticles/PlatformParticles/_ViewController/TrackingViewController.swift @@ -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) diff --git a/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved b/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7d9595b53..44030d6e4 100644 --- a/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "975d00e29efb8d2ca017c5e61df90418ac01f7d7143e85a3f9ddb4eb982154e4", + "originHash" : "1c0055be4aba3ed4d97a2f62f05486877839310f65e2cbdd18b067bef06a04a3", "pins" : [ { "identity" : "bigint", @@ -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", diff --git a/dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift b/dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift index 38c922ab3..a1205a071 100644 --- a/dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift +++ b/dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift @@ -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" @@ -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) diff --git a/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift b/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift index 51c452c22..47f88e996 100644 --- a/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift +++ b/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift @@ -14,7 +14,6 @@ import PlatformUI import Combine import dydxStateManager import Abacus -import dydxAnalytics public class dydxMarketInfoViewBuilder: NSObject, ObjectBuilderProtocol { public func build() -> T? { @@ -27,12 +26,9 @@ public class dydxMarketInfoViewBuilder: NSObject, ObjectBuilderProtocol { } private class dydxMarketInfoViewController: HostingViewController { - 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 { diff --git a/dydx/dydxPresenters/dydxPresenters/_v4/Markets/dydxMarketsViewBuilder.swift b/dydx/dydxPresenters/dydxPresenters/_v4/Markets/dydxMarketsViewBuilder.swift index dbcdbcac5..b0677bd27 100644 --- a/dydx/dydxPresenters/dydxPresenters/_v4/Markets/dydxMarketsViewBuilder.swift +++ b/dydx/dydxPresenters/dydxPresenters/_v4/Markets/dydxMarketsViewBuilder.swift @@ -16,7 +16,6 @@ import dydxStateManager import Combine import Charts import dydxFormatter -import dydxAnalytics public class dydxMarketsViewBuilder: NSObject, ObjectBuilderProtocol { public func build() -> T? { @@ -30,7 +29,7 @@ public class dydxMarketsViewBuilder: NSObject, ObjectBuilderProtocol { private class dydxMarketsViewController: HostingViewController { override public func arrive(to request: RoutingRequest?, animated: Bool) -> Bool { - request?.path == "/markets" + request?.path == "/portfolio/overview" || request?.path == "/markets" } }