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: Better calendar onboarding mac #1140

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Mail/Views/SplitView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class SplitViewManager: ObservableObject {
var splitViewController: UISplitViewController?

func adaptToProminentThreadView() {
guard !platformDetector.isMacCatalyst, !platformDetector.isiOSAppOnMac else {
guard !platformDetector.isMac else {
return
}

Expand Down Expand Up @@ -89,7 +89,7 @@ struct SplitView: View {
} else {
NavigationView {
MenuDrawerView()
.navigationBarHidden(!(platformDetector.isMacCatalyst || platformDetector.isiOSAppOnMac))
.navigationBarHidden(!platformDetector.isMac)

ThreadListManagerView()

Expand Down Expand Up @@ -176,7 +176,7 @@ struct SplitView: View {
}

private func setupBehaviour(orientation: UIInterfaceOrientation) {
if platformDetector.isMacCatalyst || platformDetector.isiOSAppOnMac {
if platformDetector.isMac {
splitViewController?.preferredSplitBehavior = .tile
splitViewController?.preferredDisplayMode = .twoBesideSecondary
splitViewController?.presentsWithGesture = false
Expand Down
9 changes: 8 additions & 1 deletion Mail/Views/Sync Profile/SyncInstallProfileTutorialView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ struct SyncInstallProfileTutorialView: View {
VStack {
MailButton(label: MailResourcesStrings.Localizable.buttonGoToSettings) {
matomo.track(eventWithCategory: .syncAutoConfig, name: "openSettings")
openURL(URL(string: "App-prefs:")!)
@InjectService var platformDetector: PlatformDetectable
let url: URL
if platformDetector.isMac {
url = DeeplinkConstants.macSecurityAndPrivacy
} else {
url = DeeplinkConstants.iosPreferences
}
openURL(url)
}
.mailButtonFullWidth(true)
if userCameBackFromSettings {
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Thread List/ThreadListCellContextMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct ThreadListCellContextMenu: ViewModifier {
let thread: Thread

private var actions: [Action] {
return (platformDetector.isMacCatalyst || platformDetector.isiOSAppOnMac) ? Action.rightClickActions : []
return platformDetector.isMac ? Action.rightClickActions : []
}

func body(content: Content) -> some View {
Expand Down
5 changes: 5 additions & 0 deletions MailCore/Utils/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ import MailResources
import SwiftSoup
import SwiftUI

public enum DeeplinkConstants {
public static let macSecurityAndPrivacy = URL(string: "x-apple.systempreferences:com.apple.preference.security")!
public static let iosPreferences = URL(string: "App-prefs:")!
}

public struct URLConstants {
public static let testFlight = URLConstants(urlString: "https://testflight.apple.com/join/t8dXx60N")
public static let appStore = URLConstants(urlString: "https://apps.apple.com/app/infomaniak-mail/id1622596573")
Expand Down
2 changes: 1 addition & 1 deletion MailCore/Utils/Model/Realm/RealmAccessible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension RealmAccessible {
Logging.reportRealmOpeningError(error, realmConfiguration: realmConfiguration, afterRetry: !canRetry)

@InjectService var platformDetector: PlatformDetectable
let isOnMacContext = (platformDetector.isMacCatalyst || platformDetector.isiOSAppOnMac)
let isOnMacContext = platformDetector.isMac

guard isOnMacContext else {
// Delete configuration for iOS / iPadOS in debug
Expand Down
Loading