From 72801485e79931145341f6fb164c30c88d0e6b0b Mon Sep 17 00:00:00 2001 From: Valentin Perignon Date: Thu, 27 Jul 2023 16:03:25 +0200 Subject: [PATCH 1/2] feat(SettingsView): Display lock settings if available --- .../Views/Settings/General/SettingsView.swift | 19 ++++++++++++------- Mail/Views/Settings/SettingsToggleCell.swift | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Mail/Views/Settings/General/SettingsView.swift b/Mail/Views/Settings/General/SettingsView.swift index f6f0206c2..ddafc07bd 100644 --- a/Mail/Views/Settings/General/SettingsView.swift +++ b/Mail/Views/Settings/General/SettingsView.swift @@ -18,6 +18,7 @@ import InfomaniakCore import InfomaniakCoreUI +import InfomaniakDI import MailCore import MailResources import SwiftUI @@ -25,6 +26,8 @@ import SwiftUI struct SettingsView: View { @EnvironmentObject private var mailboxManager: MailboxManager + @LazyInjectService private var appLockHelper: AppLockHelper + @AppStorage(UserDefaults.shared.key(.threadDensity)) private var density = DefaultPreferences.threadDensity @AppStorage(UserDefaults.shared.key(.theme)) private var theme = DefaultPreferences.theme @AppStorage(UserDefaults.shared.key(.accentColor)) private var accentColor = DefaultPreferences.accentColor @@ -52,13 +55,15 @@ struct SettingsView: View { Text(MailResourcesStrings.Localizable.settingsSectionGeneral) .textStyle(.bodySmallSecondary) - SettingsToggleCell( - title: MailResourcesStrings.Localizable.settingsAppLock, - userDefaults: \.isAppLockEnabled, - matomoCategory: .settingsGeneral, - matomoName: "lock" - ) - .settingCellModifier() + if appLockHelper.isAvailable { + SettingsToggleCell( + title: MailResourcesStrings.Localizable.settingsAppLock, + userDefaults: \.isAppLockEnabled, + matomoCategory: .settingsGeneral, + matomoName: "lock" + ) + .settingCellModifier() + } SettingsSubMenuCell(title: MailResourcesStrings.Localizable.settingsMailboxGeneralNotifications) { SettingsNotificationsView() diff --git a/Mail/Views/Settings/SettingsToggleCell.swift b/Mail/Views/Settings/SettingsToggleCell.swift index 7dfc570f4..c6fa58bb8 100644 --- a/Mail/Views/Settings/SettingsToggleCell.swift +++ b/Mail/Views/Settings/SettingsToggleCell.swift @@ -24,8 +24,8 @@ import MailResources import SwiftUI struct SettingsToggleCell: View { - @LazyInjectService var appLockHelper: AppLockHelper - @LazyInjectService var matomo: MatomoUtils + @LazyInjectService private var appLockHelper: AppLockHelper + @LazyInjectService private var matomo: MatomoUtils let title: String let userDefaults: ReferenceWritableKeyPath From 22909994c10982298d308aa6eda5020918e38741 Mon Sep 17 00:00:00 2001 From: Valentin Perignon Date: Fri, 28 Jul 2023 14:12:59 +0200 Subject: [PATCH 2/2] feat: Bump core-ui --- .package.resolved | 30 +++++++++++++++--------------- Project.swift | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.package.resolved b/.package.resolved index 5d20711ce..aaa57d82f 100644 --- a/.package.resolved +++ b/.package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ProxymanApp/atlantis", "state" : { - "revision" : "f6f7be1330bd4f847b6d52278acd88516eaac471", - "version" : "1.21.1" + "revision" : "cfa72085bce2600b28e47fdbbbfa2d5b96f0392b", + "version" : "1.22.0" } }, { @@ -41,7 +41,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-core", "state" : { - "revision" : "703685e70f20e4cf802f98a918b157918dadb377" + "revision" : "4eaefd644f75d833d6b1009dd94a9d6d674ccb53" } }, { @@ -49,8 +49,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-core-ui", "state" : { - "revision" : "57104919b320d5b0d1bcb4d92a3e8117e98dabb6", - "version" : "2.5.0" + "revision" : "e9a466563a94d92cde8e8c3e48cf94879212de63", + "version" : "2.5.2" } }, { @@ -139,8 +139,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/kean/Nuke", "state" : { - "revision" : "c3864b8882bc69f5edfe5c70e18786c91d228b28", - "version" : "12.1.3" + "revision" : "989586f86b683680f7bd5765d6a5683edbea0c1b", + "version" : "12.1.4" } }, { @@ -157,8 +157,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/realm/realm-core.git", "state" : { - "revision" : "f1434caadda443b4ed2261b91ea4f43ab1ee2aa5", - "version" : "13.15.1" + "revision" : "f1e962cd447f8b69f8f7cf46a188b1c6246923c5", + "version" : "13.17.0" } }, { @@ -166,8 +166,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/realm/realm-swift", "state" : { - "revision" : "b287dc102036ff425bd8a88483f0a5596871f05e", - "version" : "10.41.0" + "revision" : "0155caac1a0830a9fbaaffe5866b909fad3a6fc4", + "version" : "10.41.1" } }, { @@ -175,8 +175,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/getsentry/sentry-cocoa", "state" : { - "revision" : "d277532e1c8af813981ba01f591b15bbdd735615", - "version" : "8.8.0" + "revision" : "259d8bc75aa4028416535d35840ff19fc7661292", + "version" : "8.9.3" } }, { @@ -246,8 +246,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/siteline/SwiftUI-Introspect", "state" : { - "revision" : "adb9e7a69fd75322dcdee0c20f2fb6640d6f0087", - "version" : "0.9.0" + "revision" : "ccb973cfff703cba53fb88197413485c060eb26b", + "version" : "0.10.0" } }, { diff --git a/Project.swift b/Project.swift index 95ae158c5..a216d2316 100644 --- a/Project.swift +++ b/Project.swift @@ -29,8 +29,8 @@ let project = Project(name: "Mail", packages: [ .package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "4.0.0")), .package(url: "https://github.com/Infomaniak/ios-dependency-injection", .upToNextMajor(from: "1.1.6")), - .package(url: "https://github.com/Infomaniak/ios-core", .revision("703685e70f20e4cf802f98a918b157918dadb377")), - .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "2.3.0")), + .package(url: "https://github.com/Infomaniak/ios-core", .revision("4eaefd644f75d833d6b1009dd94a9d6d674ccb53")), + .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "2.5.2")), .package(url: "https://github.com/Infomaniak/ios-notifications", .upToNextMajor(from: "3.0.0")), .package(url: "https://github.com/Infomaniak/ios-create-account", .upToNextMajor(from: "1.1.0")), .package(url: "https://github.com/Infomaniak/ios-bug-tracker", .upToNextMajor(from: "2.0.0")),