Skip to content

Commit

Permalink
change logic to display prediction markets notice
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx committed Aug 13, 2024
1 parent 71f61c0 commit 53e31f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ private class dydxMarketInfoViewPresenter: HostedViewPresenter<dydxMarketInfoVie
.trades: fillsPresenter,
.funding: fundingPresenter
]

fileprivate static var hidePredictionMarketsNotice: Bool {
get { SettingsStore.shared?.value(forKey: dydxSettingsStoreKey.hidePredictionMarketsNoticeKey.rawValue) as? Bool ?? false }
}

override init() {
let viewModel = dydxMarketInfoViewModel()
Expand Down Expand Up @@ -170,7 +174,7 @@ private class dydxMarketInfoViewPresenter: HostedViewPresenter<dydxMarketInfoVie
guard let marketId = self?.marketId,
let assetId = marketMap[marketId]?.assetId,
let asset = assetMap[assetId] else { return }
if asset.tags?.contains("Prediction Market") == true {
if asset.tags?.contains("Prediction Market") != true && !Self.hidePredictionMarketsNotice {
Router.shared?.navigate(to: RoutingRequest(path: "/trade/prediction_markets_notice"), animated: true, completion: nil)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class dydxPredictionMarketsNoticeViewBuilder: NSObject, ObjectBuilderProt
private class dydxPredictionMarketsNoticeViewController: HostingViewController<PlatformView, dydxPredictionMarketsNoticeViewModel> {
override public func arrive(to request: RoutingRequest?, animated: Bool) -> Bool {
if request?.path == "/trade/prediction_markets_notice" {
return !dydxPredictionMarketsNoticeViewPresenter.hidePredictionMarketsNotice
return true
}
return false
}
Expand Down

0 comments on commit 53e31f7

Please sign in to comment.