mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-06-07 06:18:54 +00:00
Cleanup
This commit is contained in:
parent
07bbd6dc13
commit
ce27e4dda5
2 changed files with 13 additions and 13 deletions
|
@ -81,10 +81,12 @@ struct NotificationsTab: View {
|
||||||
|
|
||||||
private func clearNotifications() {
|
private func clearNotifications() {
|
||||||
if selectedTab == .notifications || isSecondaryColumn {
|
if selectedTab == .notifications || isSecondaryColumn {
|
||||||
if let token = appAccount.currentAccount.oauthToken {
|
if let token = appAccount.currentAccount.oauthToken, userPreferences.notificationsCount[token] ?? 0 > 0 {
|
||||||
userPreferences.notificationsCount[token] = 0
|
userPreferences.notificationsCount[token] = 0
|
||||||
}
|
}
|
||||||
watcher.unreadNotificationsCount = 0
|
if watcher.unreadNotificationsCount > 0 {
|
||||||
|
watcher.unreadNotificationsCount = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,19 +29,17 @@ public struct NotificationsListView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
public var body: some View {
|
public var body: some View {
|
||||||
ScrollViewReader { proxy in
|
List {
|
||||||
List {
|
scrollToTopView
|
||||||
scrollToTopView
|
topPaddingView
|
||||||
topPaddingView
|
if lockedAccountId == nil, let summary = viewModel.policy?.summary {
|
||||||
if lockedAccountId == nil, let summary = viewModel.policy?.summary {
|
NotificationsHeaderFilteredView(filteredNotifications: summary)
|
||||||
NotificationsHeaderFilteredView(filteredNotifications: summary)
|
|
||||||
}
|
|
||||||
notificationsView
|
|
||||||
}
|
}
|
||||||
.id(account.account?.id)
|
notificationsView
|
||||||
.environment(\.defaultMinListRowHeight, 1)
|
|
||||||
.listStyle(.plain)
|
|
||||||
}
|
}
|
||||||
|
.id(account.account?.id)
|
||||||
|
.environment(\.defaultMinListRowHeight, 1)
|
||||||
|
.listStyle(.plain)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .principal) {
|
ToolbarItem(placement: .principal) {
|
||||||
let title = lockedType?.menuTitle() ?? viewModel.selectedType?.menuTitle() ?? "notifications.navigation-title"
|
let title = lockedType?.menuTitle() ?? viewModel.selectedType?.menuTitle() ?? "notifications.navigation-title"
|
||||||
|
|
Loading…
Reference in a new issue