Skip to content

Commit

Permalink
Disable all subscription-based features
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Jul 27, 2023
1 parent 0442876 commit 3b42959
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ class SubscriptionManager {
self.localStorage = localStorage
self.marketKit = marketKit

authToken = localStorage.value(for: keyAuthToken)
marketKit.set(proAuthToken: authToken)
isAuthenticated = authToken != nil
// authToken = localStorage.value(for: keyAuthToken)
// marketKit.set(proAuthToken: authToken)
// isAuthenticated = authToken != nil

authToken = nil
isAuthenticated = true
}

private func invalidateAuthToken() {
Expand All @@ -42,19 +45,21 @@ extension SubscriptionManager {
let result = try await request()
onSuccess(result)
} catch {
if let responseError = error as? NetworkManager.ResponseError, (responseError.statusCode == 401 || responseError.statusCode == 403) {
invalidateAuthToken()
onInvalidAuthToken()
} else {
onFailure(error)
}
// if let responseError = error as? NetworkManager.ResponseError, (responseError.statusCode == 401 || responseError.statusCode == 403) {
// invalidateAuthToken()
// onInvalidAuthToken()
// } else {
// onFailure(error)
// }

onFailure(error)
}
}

func set(authToken: String) {
marketKit.set(proAuthToken: authToken)
self.authToken = authToken
localStorage.set(value: authToken, for: keyAuthToken)
// marketKit.set(proAuthToken: authToken)
// self.authToken = authToken
// localStorage.set(value: authToken, for: keyAuthToken)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ extension MainSettingsViewController: SectionsDataSource {
var sections: [SectionProtocol] = [
Section(id: "account", headerState: .margin(height: .margin12), rows: accountRows),
Section(id: "wallet_connect", headerState: .margin(height: .margin32), rows: walletConnectRows),
Section(id: "personal_support", headerState: .margin(height: .margin32), rows: supportRows),
// Section(id: "personal_support", headerState: .margin(height: .margin32), rows: supportRows),
Section(id: "appearance_settings", headerState: .margin(height: .margin32), rows: appearanceRows),
Section(id: "experimental", headerState: .margin(height: .margin32), rows: experimentalRows),
Section(id: "knowledge", headerState: .margin(height: .margin32), rows: knowledgeRows),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ extension WalletViewModel {
}

var swipeActionsEnabled: Bool {
!service.watchAccount
!service.watchAccount && !service.cexAccount
}

var lastCreatedAccount: Account? {
Expand Down

0 comments on commit 3b42959

Please sign in to comment.