mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-16 04:06:36 +00:00
Fix notifications locked type
This commit is contained in:
parent
a09b2fa95e
commit
fa4603e77c
2 changed files with 5 additions and 1 deletions
|
@ -91,6 +91,7 @@ public struct NotificationsListView: View {
|
||||||
viewModel.client = client
|
viewModel.client = client
|
||||||
viewModel.currentAccount = account
|
viewModel.currentAccount = account
|
||||||
if let lockedType {
|
if let lockedType {
|
||||||
|
viewModel.isLockedType = true
|
||||||
viewModel.selectedType = lockedType
|
viewModel.selectedType = lockedType
|
||||||
}
|
}
|
||||||
await viewModel.fetchNotifications()
|
await viewModel.fetchNotifications()
|
||||||
|
|
|
@ -38,13 +38,16 @@ import SwiftUI
|
||||||
|
|
||||||
private let filterKey = "notification-filter"
|
private let filterKey = "notification-filter"
|
||||||
var state: State = .loading
|
var state: State = .loading
|
||||||
|
var isLockedType: Bool = false
|
||||||
var selectedType: Models.Notification.NotificationType? {
|
var selectedType: Models.Notification.NotificationType? {
|
||||||
didSet {
|
didSet {
|
||||||
guard oldValue != selectedType,
|
guard oldValue != selectedType,
|
||||||
let id = client?.id
|
let id = client?.id
|
||||||
else { return }
|
else { return }
|
||||||
|
|
||||||
UserDefaults.standard.set(selectedType?.rawValue ?? "", forKey: filterKey)
|
if !isLockedType {
|
||||||
|
UserDefaults.standard.set(selectedType?.rawValue ?? "", forKey: filterKey)
|
||||||
|
}
|
||||||
|
|
||||||
consolidatedNotifications = []
|
consolidatedNotifications = []
|
||||||
Task {
|
Task {
|
||||||
|
|
Loading…
Reference in a new issue