Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add sync profile sheet for macOS only #1379

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Mail/Views/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct SettingsView: View {
@LazyInjectService private var appLockHelper: AppLockHelper
@LazyInjectService private var featureFlagsManageable: FeatureFlagsManageable
@LazyInjectService private var matomo: MatomoUtils
@LazyInjectService private var platformDetector: PlatformDetectable

@EnvironmentObject private var mailboxManager: MailboxManager
@EnvironmentObject private var mainViewState: MainViewState
Expand All @@ -43,6 +44,8 @@ struct SettingsView: View {
@AppStorage(UserDefaults.shared.key(.threadMode)) private var threadMode = DefaultPreferences.threadMode
@AppStorage(UserDefaults.shared.key(.autoAdvance)) private var autoAdvance = DefaultPreferences.autoAdvance

@State private var isShowingSyncProfile = false

var body: some View {
ScrollView {
VStack(alignment: .leading, spacing: 0) {
Expand Down Expand Up @@ -89,7 +92,11 @@ struct SettingsView: View {

Button {
matomo.track(eventWithCategory: .syncAutoConfig, name: "openFromSettings")
mainViewState.isShowingSyncProfile = true
if platformDetector.isMac {
isShowingSyncProfile = true
} else {
mainViewState.isShowingSyncProfile = true
}
} label: {
SettingsSubMenuLabel(title: MailResourcesStrings.Localizable.syncCalendarsAndContactsTitle)
}
Expand Down Expand Up @@ -191,6 +198,9 @@ struct SettingsView: View {
.onChange(of: threadMode) { _ in
accountManager.updateConversationSettings()
}
.sheet(isPresented: $isShowingSyncProfile) {
SyncProfileNavigationView()
}
.background(MailResourcesAsset.backgroundColor.swiftUIColor)
.navigationBarTitle(MailResourcesStrings.Localizable.settingsTitle, displayMode: .inline)
.backButtonDisplayMode(.minimal)
Expand Down
Loading