Skip to content

Commit

Permalink
Feature/debug (#77)
Browse files Browse the repository at this point in the history
* According to comments to Mike's PR

* Change back to use "sandboxReceipt". Even though it is undocumented, it should work. No need to spend more time on it

* DebugEnabled should only be used for showing the debug screen

* clean up code
  • Loading branch information
johnqh authored and mike-dydx committed Aug 21, 2024
1 parent ed9d3ea commit ecfeaf7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ private class dydxSettingsLandingViewPresenter: SettingsLandingViewPresenter {

init() {
let definitionFile: String
if DebugEnabled.enabled {
switch Installation.source {
case .debug:
definitionFile = "settings_debug.json"
} else {

case .testFlight:
definitionFile = DebugEnabled.enabled ? "settings_debug.json" : "settings.json"

default:
// Other than during debugging and DebugEnabled for TestFlight build, we should never show the debug screen
definitionFile = "settings.json"
}

super.init(definitionFile: definitionFile,
keyValueStore: SettingsStore.shared,
appScheme: Bundle.main.scheme)
Expand Down
18 changes: 8 additions & 10 deletions dydx/dydxStateManager/dydxStateManager/AbacusStateManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,23 @@ public final class AbacusStateManager: NSObject {
if dydxBoolFeatureFlag.force_mainnet.isEnabled {
deployment = "MAINNET"
appConfigs = AppConfigs.companion.forApp
} else if DebugEnabled.enabled {
// For debugging only
deployment = "DEV"
#if DEBUG
appConfigs = AppConfigs.companion.forAppDebug
#else
appConfigs = AppConfigs.companion.forApp
#endif
} else {
// Expose more options for Testflight build
switch Installation.source {
case .appStore:
deployment = "MAINNET"
case .debug, .jailBroken:
appConfigs = AppConfigs.companion.forApp
case .debug:
// For debugging only
deployment = "DEV"
appConfigs = AppConfigs.companion.forAppDebug
case .jailBroken:
deployment = "TESTNET"
appConfigs = AppConfigs.companion.forApp
case .testFlight:
deployment = "TESTFLIGHT"
appConfigs = AppConfigs.companion.forApp
}
appConfigs = AppConfigs.companion.forApp
}

appConfigs.squidVersion = AppConfigs.SquidVersion.v2
Expand Down

0 comments on commit ecfeaf7

Please sign in to comment.