-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added key for full maintenance mode. Handle showing of dedicated view. * Implemented UI for full maintenance mode view * Extended structure of maintenance data * Notify about flag updated Handle flag updated in maintenance view * Created ud feature flag tracker object * Refactoring * Added flag to track OKLink availability * Handle profiles API service is down * Handle Ecomm API service is down * Handle attempt to open domain profile when profiles api services is down * Handle Infura service is down * Handle MPC service is down * Restrict mpc purchase when ecomm is in maintenance * Enhanced maintenance mode data. Added tests. * Improved full maintenance handling * Handle maintenance status updated in flag tracker
- Loading branch information
1 parent
77737a5
commit 9780100
Showing
40 changed files
with
1,111 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
unstoppable-ios-app/domains-manager-ios/Entities/MaintenanceModeData.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// | ||
// MaintenanceModeData.swift | ||
// domains-manager-ios | ||
// | ||
// Created by Oleg Kuplin on 23.07.2024. | ||
// | ||
|
||
import Foundation | ||
|
||
struct MaintenanceModeData: Codable { | ||
private let isOn: Bool | ||
var link: String? | ||
var title: String? | ||
var message: String? | ||
var startDate: Date? | ||
var endDate: Date? | ||
|
||
init(isOn: Bool, | ||
link: String? = nil, | ||
title: String? = nil, | ||
message: String? = nil, | ||
startDate: Date? = nil, | ||
endDate: Date? = nil) { | ||
self.isOn = isOn | ||
self.link = link | ||
self.title = title | ||
self.message = message | ||
self.startDate = startDate | ||
self.endDate = endDate | ||
} | ||
|
||
var isCurrentlyEnabled: Bool { | ||
if isOn { | ||
/// If there's a startDate set, we check if it is already started,. Otherwise return true | ||
if let startDate { | ||
if startDate > Date() { | ||
return false | ||
} else if let endDate { /// If there's end date, we check if it is already ended. Otherwise return true | ||
return endDate >= Date() | ||
} | ||
return true | ||
} else if let endDate { | ||
return endDate >= Date() | ||
} | ||
|
||
return true | ||
} | ||
return false | ||
} | ||
|
||
var linkURL: URL? { URL(string: link ?? "") } | ||
|
||
func onMaintenanceStatusUpdate(callback: @escaping EmptyCallback) { | ||
let now = Date() | ||
|
||
func scheduleUpdatedAfter(date: Date) { | ||
let timeInterval = date.timeIntervalSince(now) + 1 | ||
DispatchQueue.main.asyncAfter(deadline: .now() + timeInterval) { | ||
callback() | ||
} | ||
} | ||
|
||
if let startDate, | ||
startDate > now { | ||
scheduleUpdatedAfter(date: startDate) | ||
} else if let endDate, | ||
endDate > now { | ||
scheduleUpdatedAfter(date: endDate) | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.