@@ -70,7 +70,7 @@ struct ContentView: View {
70
70
selectedServer: server,
71
71
columnVisibility: $columnVisibility,
72
72
showingEditor: $showingEditor,
73
- needsRefresh: $needsRefresh,
73
+ needsRefresh: $needsRefresh
74
74
)
75
75
. id ( server. url)
76
76
. onAppear {
@@ -143,6 +143,8 @@ public struct AuthViewContainer: View {
143
143
@Environment ( \. presentationMode) private var presentationMode : Binding < PresentationMode >
144
144
@Query private var items : [ DjangoFilesSession ]
145
145
146
+ @State private var isAuthViewLoading : Bool = true
147
+
146
148
var viewingSettings : Binding < Bool >
147
149
let selectedServer : DjangoFilesSession
148
150
var columnVisibility : Binding < NavigationSplitViewVisibility >
@@ -151,30 +153,27 @@ public struct AuthViewContainer: View {
151
153
152
154
@State private var authController : AuthController = AuthController ( )
153
155
154
- var backButton : some View { Button ( action: {
155
- self . presentationMode. wrappedValue. dismiss ( )
156
- } ) {
157
- HStack {
158
- if !UIDevice. current. localizedModel. contains ( " iPad " ) {
159
- Text ( " Server List " )
160
- }
161
- }
162
- }
163
- }
164
156
public var body : some View {
165
- if selectedServer. url != " " {
166
- ZStack {
167
- Color . djangoFilesBackground. ignoresSafeArea ( )
168
- LoadingView ( ) . frame ( width: 100 , height: 100 )
157
+ if viewingSettings. wrappedValue{
158
+ SessionSelector ( session: selectedServer, viewingSelect: viewingSettings)
159
+ . onAppear ( ) {
160
+ columnVisibility. wrappedValue = . automatic
161
+ }
162
+ }
163
+ else if selectedServer. url != " " {
164
+ Color . djangoFilesBackground. ignoresSafeArea ( )
165
+ . overlay {
169
166
AuthView (
170
167
authController: authController,
171
168
httpsUrl: selectedServer. url,
172
169
doReset: authController. url? . absoluteString ?? " " != selectedServer. url || !selectedServer. auth,
173
170
session: selectedServer
174
171
)
175
172
. onStartedLoading {
173
+ isAuthViewLoading = true
176
174
}
177
175
. onCancelled {
176
+ isAuthViewLoading = false
178
177
dismiss ( )
179
178
}
180
179
. onAppear ( ) {
@@ -186,11 +185,17 @@ public struct AuthViewContainer: View {
186
185
authController. onStartedLoadingAction = {
187
186
}
188
187
188
+ authController. onLoadedAction = {
189
+ isAuthViewLoading = false
190
+
191
+ }
189
192
authController. onCancelledAction = {
193
+ isAuthViewLoading = false
190
194
dismiss ( )
191
195
}
192
196
193
197
authController. onSchemeRedirectAction = {
198
+ isAuthViewLoading = false
194
199
guard let resolve = authController. schemeURL else {
195
200
return
196
201
}
@@ -220,6 +225,11 @@ public struct AuthViewContainer: View {
220
225
}
221
226
}
222
227
}
228
+ . overlay {
229
+ if isAuthViewLoading {
230
+ LoadingView ( ) . frame ( width: 100 , height: 100 )
231
+ }
232
+ }
223
233
}
224
234
. ignoresSafeArea ( )
225
235
. edgesIgnoringSafeArea ( . all)
0 commit comments