From 8ab62922ff9f7b8a29c1f0f10078ec5e6cd3c436 Mon Sep 17 00:00:00 2001 From: Geoff Pado Date: Fri, 5 Jul 2024 19:39:59 -0700 Subject: [PATCH] Fix issues with macOS --- .../SettingsUI/Sources/Web URLs/URLExtensions.swift | 2 +- .../Sources/Application/Help Menu/HelpMenuAboutAction.swift | 4 ++-- .../Help Menu/HelpMenuAcknowledgementsAction.swift | 4 ++-- .../Sources/Application/Help Menu/HelpMenuContactAction.swift | 4 ++-- .../Sources/Application/Help Menu/HelpMenuPrivacyAction.swift | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Modules/Capabilities/SettingsUI/Sources/Web URLs/URLExtensions.swift b/Modules/Capabilities/SettingsUI/Sources/Web URLs/URLExtensions.swift index 720e074b..e2b17c9a 100644 --- a/Modules/Capabilities/SettingsUI/Sources/Web URLs/URLExtensions.swift +++ b/Modules/Capabilities/SettingsUI/Sources/Web URLs/URLExtensions.swift @@ -4,7 +4,7 @@ import ErrorHandling import Foundation -extension URL { +public extension URL { init(websitePath: StaticString) { self = URL.websiteBaseURL.appendingPathComponent(String(websitePath)) } diff --git a/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuAboutAction.swift b/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuAboutAction.swift index cf263c9a..6b219286 100644 --- a/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuAboutAction.swift +++ b/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuAboutAction.swift @@ -8,13 +8,13 @@ import UIKit class HelpMenuAboutAction: UIAction { convenience init(void: Void = ()) { self.init(title: Self.menuItemTitle) { _ in - UIApplication.shared.open(WebURLButton.url(forPath: "about"), options: [:], completionHandler: nil) + UIApplication.shared.open(URL(websitePath: "about"), options: [:], completionHandler: nil) } } // MARK: Boilerplate - private static let menuItemTitle = NSLocalizedString("SettingsContentProvider.Item.about", comment: "About menu item title") + private static let menuItemTitle = SettingsUIStrings.SettingsContentInformationSection.aboutTitle @available(*, unavailable) required init(coder: NSCoder) { diff --git a/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuAcknowledgementsAction.swift b/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuAcknowledgementsAction.swift index 21197120..a6cd4700 100644 --- a/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuAcknowledgementsAction.swift +++ b/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuAcknowledgementsAction.swift @@ -8,13 +8,13 @@ import UIKit class HelpMenuAcknowledgementsAction: UIAction { convenience init(void: Void = ()) { self.init(title: Self.menuItemTitle) { _ in - UIApplication.shared.open(WebURLButton.url(forPath: "acknowledgements"), options: [:], completionHandler: nil) + UIApplication.shared.open(URL(websitePath: "acknowledgements"), options: [:], completionHandler: nil) } } // MARK: Boilerplate - private static let menuItemTitle = NSLocalizedString("SettingsContentProvider.Item.acknowledgements", comment: "Acknowledgements menu item title") + private static let menuItemTitle = SettingsUIStrings.SettingsContentInformationSection.acknowledgementsTitle @available(*, unavailable) required init(coder: NSCoder) { diff --git a/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuContactAction.swift b/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuContactAction.swift index a759f0c5..99379428 100644 --- a/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuContactAction.swift +++ b/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuContactAction.swift @@ -8,13 +8,13 @@ import UIKit class HelpMenuContactAction: UIAction { convenience init(void: Void = ()) { self.init(title: Self.menuItemTitle) { _ in - UIApplication.shared.open(WebURLButton.url(forPath: "contact"), options: [:], completionHandler: nil) + UIApplication.shared.open(URL(websitePath: "contact"), options: [:], completionHandler: nil) } } // MARK: Boilerplate - private static let menuItemTitle = NSLocalizedString("SettingsContentProvider.Item.contact", comment: "Contact menu item title") + private static let menuItemTitle = SettingsUIStrings.SettingsContentContactSection.header @available(*, unavailable) required init(coder: NSCoder) { diff --git a/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuPrivacyAction.swift b/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuPrivacyAction.swift index dc955c43..e30b2d7b 100644 --- a/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuPrivacyAction.swift +++ b/Modules/Legacy/Core/Sources/Application/Help Menu/HelpMenuPrivacyAction.swift @@ -8,13 +8,13 @@ import UIKit class HelpMenuPrivacyAction: UIAction { convenience init(void: Void = ()) { self.init(title: Self.menuItemTitle) { _ in - UIApplication.shared.open(WebURLButton.url(forPath: "privacy"), options: [:], completionHandler: nil) + UIApplication.shared.open(URL(websitePath: "privacy"), options: [:], completionHandler: nil) } } // MARK: Boilerplate - private static let menuItemTitle = NSLocalizedString("SettingsContentProvider.Item.privacy", comment: "Privacy menu item title") + private static let menuItemTitle = SettingsUIStrings.SettingsContentInformationSection.privacyTitle @available(*, unavailable) required init(coder: NSCoder) {