mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-23 13:06:16 +00:00
Switch to iOS 17 inspector
This commit is contained in:
parent
15f498037d
commit
7589ab75f8
3 changed files with 34 additions and 32 deletions
|
@ -113,8 +113,6 @@ struct IceCubesApp: App {
|
||||||
popToRootTab: $popToRootTab,
|
popToRootTab: $popToRootTab,
|
||||||
tabs: availableTabs)
|
tabs: availableTabs)
|
||||||
{
|
{
|
||||||
GeometryReader { _ in
|
|
||||||
HStack(spacing: 0) {
|
|
||||||
ZStack {
|
ZStack {
|
||||||
if selectedTab == .profile {
|
if selectedTab == .profile {
|
||||||
ProfileTab(popToRootTab: $popToRootTab)
|
ProfileTab(popToRootTab: $popToRootTab)
|
||||||
|
@ -134,15 +132,15 @@ struct IceCubesApp: App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if appAccountsManager.currentClient.isAuth,
|
}
|
||||||
userPreferences.showiPadSecondaryColumn
|
.inspector(isPresented: .init(get: {
|
||||||
{
|
appAccountsManager.currentClient.isAuth && userPreferences.showiPadSecondaryColumn
|
||||||
Divider().edgesIgnoringSafeArea(.all)
|
}, set: { newValue in
|
||||||
|
userPreferences.showiPadSecondaryColumn = newValue
|
||||||
|
}), content: {
|
||||||
notificationsSecondaryColumn
|
notificationsSecondaryColumn
|
||||||
}
|
})
|
||||||
}
|
.onChange(of: $appAccountsManager.currentAccount.id) {
|
||||||
}
|
|
||||||
}.onChange(of: $appAccountsManager.currentAccount.id) {
|
|
||||||
sideBarLoadedTabs.removeAll()
|
sideBarLoadedTabs.removeAll()
|
||||||
}
|
}
|
||||||
.environment(sidebarRouterPath)
|
.environment(sidebarRouterPath)
|
||||||
|
@ -151,8 +149,8 @@ struct IceCubesApp: App {
|
||||||
private var notificationsSecondaryColumn: some View {
|
private var notificationsSecondaryColumn: some View {
|
||||||
NotificationsTab(popToRootTab: $popToRootTab, lockedType: nil)
|
NotificationsTab(popToRootTab: $popToRootTab, lockedType: nil)
|
||||||
.environment(\.isSecondaryColumn, true)
|
.environment(\.isSecondaryColumn, true)
|
||||||
.frame(maxWidth: .secondaryColumnWidth)
|
|
||||||
.id(appAccountsManager.currentAccount.id)
|
.id(appAccountsManager.currentAccount.id)
|
||||||
|
.inspectorColumnWidth(.secondaryColumnWidth)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var tabBarView: some View {
|
private var tabBarView: some View {
|
||||||
|
|
|
@ -75,6 +75,7 @@ public struct NotificationsListView: View {
|
||||||
.scrollContentBackground(.hidden)
|
.scrollContentBackground(.hidden)
|
||||||
.background(theme.primaryBackgroundColor)
|
.background(theme.primaryBackgroundColor)
|
||||||
.task {
|
.task {
|
||||||
|
if client.isAuth {
|
||||||
viewModel.client = client
|
viewModel.client = client
|
||||||
viewModel.currentAccount = account
|
viewModel.currentAccount = account
|
||||||
if let lockedType {
|
if let lockedType {
|
||||||
|
@ -82,6 +83,7 @@ public struct NotificationsListView: View {
|
||||||
}
|
}
|
||||||
await viewModel.fetchNotifications()
|
await viewModel.fetchNotifications()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.refreshable {
|
.refreshable {
|
||||||
SoundEffectManager.shared.playSound(of: .pull)
|
SoundEffectManager.shared.playSound(of: .pull)
|
||||||
HapticManager.shared.fireHaptic(of: .dataRefresh(intensity: 0.3))
|
HapticManager.shared.fireHaptic(of: .dataRefresh(intensity: 0.3))
|
||||||
|
|
|
@ -93,6 +93,8 @@ import SwiftUI
|
||||||
nextPageState: consolidatedNotifications.isEmpty ? .none : nextPageState)
|
nextPageState: consolidatedNotifications.isEmpty ? .none : nextPageState)
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
let error = error as NSError
|
||||||
|
guard error.code != -999 else { return }
|
||||||
state = .error(error: error)
|
state = .error(error: error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue