Skip to content

Commit

Permalink
refactor: better placement for .navigationDestination() (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba authored Nov 27, 2024
1 parent f10c656 commit 72943e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions Sources/Screens/Group/GroupList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ struct GroupList: View, ViewDataProvider, LoadStateProvider, TimerLifecycle, Tok
.onChange(of: searchText) {
groupStore.searchPublisher.send($1)
}
.navigationDestination(isPresented: $overviewIsPresented) {
if let newGroup {
GroupOverview(newGroup, groupStore: groupStore)
}
}
}
}
}
Expand All @@ -83,6 +78,11 @@ struct GroupList: View, ViewDataProvider, LoadStateProvider, TimerLifecycle, Tok
overviewIsPresented = true
}
}
.navigationDestination(isPresented: $overviewIsPresented) {
if let newGroup {
GroupOverview(newGroup, groupStore: groupStore)
}
}
}
.onAppear {
if let token = tokenStore.token {
Expand Down
10 changes: 5 additions & 5 deletions Sources/Screens/Organization/OrganizationList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ struct OrganizationList: View, ViewDataProvider, LoadStateProvider, TimerLifecyc
}
}
}
.navigationDestination(isPresented: $overviewIsPresented) {
if let newOrganization {
OrganizationOverview(newOrganization, organizationStore: organizationStore)
}
}
}
}
.refreshable {
Expand Down Expand Up @@ -85,6 +80,11 @@ struct OrganizationList: View, ViewDataProvider, LoadStateProvider, TimerLifecyc
overviewIsPresented = true
}
}
.navigationDestination(isPresented: $overviewIsPresented) {
if let newOrganization {
OrganizationOverview(newOrganization, organizationStore: organizationStore)
}
}
}
.onAppear {
if let token = tokenStore.token {
Expand Down
10 changes: 5 additions & 5 deletions Sources/Screens/Workspace/WorkspaceList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ struct WorkspaceList: View, ViewDataProvider, LoadStateProvider, TimerLifecycle,
.onChange(of: searchText) {
workspaceStore.searchPublisher.send($1)
}
.navigationDestination(isPresented: $overviewIsPresented) {
if let newWorkspace {
WorkspaceOverview(newWorkspace, workspaceStore: workspaceStore)
}
}
}
}
}
Expand Down Expand Up @@ -95,6 +90,11 @@ struct WorkspaceList: View, ViewDataProvider, LoadStateProvider, TimerLifecycle,
overviewIsPresented = true
}
}
.navigationDestination(isPresented: $overviewIsPresented) {
if let newWorkspace {
WorkspaceOverview(newWorkspace, workspaceStore: workspaceStore)
}
}
.sheet(isPresented: $accountIsPresented) {
AccountOverview()
}
Expand Down

0 comments on commit 72943e0

Please sign in to comment.