Skip to content

Commit

Permalink
feat: Use ReviewManager from iOS Core (#1318)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann authored Mar 1, 2024
2 parents ed0f51a + f90e5ea commit b7a9531
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-core",
"state" : {
"revision" : "7d9c15d8876c65a851ded660d700df1ddf4e3c03"
"revision" : "18f879a9a0d1a493f8a4f5e3d59ccd33e74374af"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Mail/Helpers/MailTargetAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ open class CommonAppAndShareTargetAssembly: TargetAssembly {
URLOpener()
},
Factory(type: ReviewManageable.self) { _, _ in
ReviewManager()
ReviewManager(userDefaults: UserDefaults.shared)
}
]
}
Expand Down
1 change: 1 addition & 0 deletions Mail/Views/Alerts/AskForReviewView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import InfomaniakCore
import InfomaniakCoreUI
import InfomaniakDI
import MailCore
Expand Down
63 changes: 0 additions & 63 deletions MailCore/Cache/ReviewManager.swift

This file was deleted.

1 change: 0 additions & 1 deletion MailCore/Utils/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public enum Constants {
MailResourcesStrings.Localizable.aiPromptExample5
]

public static let openingBeforeReview = 50
public static let minimumOpeningBeforeSync = 2

/// A count limit for the Contact cache in Extension mode, where we have strong memory constraints.
Expand Down
21 changes: 0 additions & 21 deletions MailCore/Utils/MailUserDefaults+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,27 +261,6 @@ public extension UserDefaults {
}
}

var openingUntilReview: Int {
get {
if object(forKey: key(.openingUntilReview)) == nil {
set(Constants.openingBeforeReview, forKey: key(.openingUntilReview))
}
return integer(forKey: key(.openingUntilReview))
}
set {
set(newValue, forKey: key(.openingUntilReview))
}
}

var appReview: ReviewType {
get {
return ReviewType(rawValue: string(forKey: key(.appReview)) ?? "") ?? .none
}
set {
set(newValue.rawValue, forKey: key(.appReview))
}
}

var shouldPresentSyncDiscovery: Bool {
get {
if object(forKey: key(.shouldPresentSyncDiscovery)) == nil {
Expand Down
2 changes: 1 addition & 1 deletion Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let project = Project(name: "Mail",
.package(url: "https://github.com/Infomaniak/swift-concurrency", .upToNextMajor(from: "0.0.4")),
.package(
url: "https://github.com/Infomaniak/ios-core",
.revision("7d9c15d8876c65a851ded660d700df1ddf4e3c03")
.revision("18f879a9a0d1a493f8a4f5e3d59ccd33e74374af")
),
.package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "4.1.0")),
.package(url: "https://github.com/Infomaniak/ios-notifications", .upToNextMajor(from: "3.0.0")),
Expand Down

0 comments on commit b7a9531

Please sign in to comment.