@@ -13,6 +13,7 @@ struct LocationsView: View {
13
13
@Environment ( FriendViewModel . self) var friendVM
14
14
@State private var columnVisibility : NavigationSplitViewVisibility = . all
15
15
@State private var selectedInstance : InstanceLocation ?
16
+ @State private var isSelectedPrivate = false
16
17
@State private var selection : SegmentIdSelection ?
17
18
18
19
var body : some View {
@@ -53,11 +54,11 @@ struct LocationsView: View {
53
54
54
55
private var content : some View {
55
56
Group {
56
- if let selectedInstance = selectedInstance {
57
- LocationDetailView (
58
- selection : $selection ,
59
- instanceLocation : selectedInstance
60
- )
57
+ if let location = selectedInstance? . location ,
58
+ let instance = selectedInstance ? . instance {
59
+ LocationDetailView ( $selection , location : location , instance : instance )
60
+ } else if let instance = selectedInstance , instance . location . location == . private {
61
+ PrivateLocationView ( $selection , friends : instance . location . friends )
61
62
}
62
63
}
63
64
. overlay {
@@ -96,7 +97,7 @@ struct LocationsView: View {
96
97
. setColumn ( )
97
98
}
98
99
99
- @ ViewBuilder private var friendLocations : some View {
100
+ private var friendLocations : some View {
100
101
Section {
101
102
if friendVM. isFetchingAllFriends {
102
103
ForEach ( 0 ... 7 , id: \. self) { _ in
@@ -143,6 +144,7 @@ struct LocationsView: View {
143
144
}
144
145
. padding ( . top, 4 )
145
146
}
147
+ . tag ( InstanceLocation ( friends: friendVM. friendsInPrivate) )
146
148
}
147
149
}
148
150
}
0 commit comments