Skip to content

Commit

Permalink
PZHelper // NotificationSettingsPageContent: Compiler optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikiSuen committed Nov 27, 2024
1 parent d9a7c9d commit 4a1896c
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ struct NotificationSettingsPageContent: View {
Image(systemSymbol: .gear)
}
#if os(macOS) || targetEnvironment(macCatalyst)
Link(destination: "x-apple.systempreferences:com.apple.preference.notifications".asURL) {
osSettingsLinkLabel
}
let urlOSSettings = "x-apple.systempreferences:com.apple.preference.notifications".asURL
#else
Link(destination: UIApplication.openSettingsURLString.asURL) {
let urlOSSettings = UIApplication.openSettingsURLString.asURL
#endif
Link(destination: urlOSSettings) {
osSettingsLinkLabel
}
#endif
}
}
NotificationSettingDetailContent()
Expand Down Expand Up @@ -338,10 +337,7 @@ private struct NotificationSettingDetailContent: View {
.textCase(.none)
.padding([.bottom])
} footer: {
#if targetEnvironment(macCatalyst)
Text("settings.notification.dateTimePicker.macCatalystNotice", bundle: .module)
.foregroundStyle(.orange)
#endif
macCatalystNoticeView
}

// 玩家体力通知提醒阈值
Expand Down Expand Up @@ -520,6 +516,15 @@ private struct NotificationSettingDetailContent: View {

// MARK: Private

@ViewBuilder private var macCatalystNoticeView: some View {
#if targetEnvironment(macCatalyst)
Text("settings.notification.dateTimePicker.macCatalystNotice", bundle: .module)
.foregroundStyle(.orange)
#else
EmptyView()
#endif
}

@ViewBuilder
private func handleBindingDateAndWeekdays<T: View>(
_ date: Binding<Date?>, _ weekday: Binding<Weekday?>,
Expand Down

0 comments on commit 4a1896c

Please sign in to comment.