Comment out application badge feature

This commit is contained in:
Jackson Harper
2023-12-21 20:33:18 +08:00
parent a99ac232ca
commit e2843b2e0c
2 changed files with 21 additions and 18 deletions

View File

@ -99,24 +99,24 @@ struct FiltersView: View {
}
}
Section(header: Text("Application Badge")) {
Toggle("Display Badge Count", isOn: $viewModel.hasBadgePermission)
.onChange(of: viewModel.hasBadgePermission) { _ in
if viewModel.hasBadgePermission {
viewModel.requestBadgePermission()
} else {
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
if viewModel.hasBadgePermission {
NavigationLink(destination: {
SelectBadgeFilterView(viewModel: viewModel)
}, label: {
Text(viewModel.badgeFilter)
})
}
}
// Section(header: Text("Application Badge")) {
// Toggle("Display Badge Count", isOn: $viewModel.hasBadgePermission)
// .onChange(of: viewModel.hasBadgePermission) { _ in
// if viewModel.hasBadgePermission {
// viewModel.requestBadgePermission()
// } else {
// UIApplication.shared.applicationIconBadgeNumber = 0
// }
// }
//
// if viewModel.hasBadgePermission {
// NavigationLink(destination: {
// SelectBadgeFilterView(viewModel: viewModel)
// }, label: {
// Text(viewModel.badgeFilter)
// })
// }
// }
}
}
}

View File

@ -56,6 +56,9 @@ private let logger = Logger(subsystem: "app.omnivore", category: "app-delegate")
Services.registerBackgroundFetch()
configureFirebase()
// TODO: remove after filter badge is re-enabled
UIApplication.shared.applicationIconBadgeNumber = 0
// swiftlint:disable:next line_length
NotificationCenter.default.addObserver(forName: Notification.Name("ReconfigurePushNotifications"), object: nil, queue: OperationQueue.main) { _ in
if UserDefaults.standard.bool(forKey: UserDefaultKey.notificationsEnabled.rawValue) {