diff options
| author | Dustin Mierau <dustin@mierau.me> | 2023-12-12 15:27:00 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2023-12-12 15:27:00 -0800 |
| commit | 248fcbbd5dca84747e6f3fd9d1d52c41ab8640c3 (patch) | |
| tree | f8f76c7b071aff2fe56c4e900c72dcbaddd3c62a /Hotline/Views/FilesView.swift | |
| parent | f71c4cae3b21db506573bcdfa9fdb6cde41cc0ca (diff) | |
New category listing is working again. Added optionset for user access info. Some UI cleanup across the board.
Diffstat (limited to 'Hotline/Views/FilesView.swift')
| -rw-r--r-- | Hotline/Views/FilesView.swift | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Hotline/Views/FilesView.swift b/Hotline/Views/FilesView.swift index 23b19b1..5cbf0c9 100644 --- a/Hotline/Views/FilesView.swift +++ b/Hotline/Views/FilesView.swift @@ -27,6 +27,10 @@ struct FileView: View { } } .onChange(of: expanded) { + if !expanded { + return + } + Task { await model.getFileList(path: file.path) } @@ -85,7 +89,7 @@ struct FileView: View { struct FilesView: View { @Environment(Hotline.self) private var model: Hotline - @State var initialLoad = false + @State var initialLoadComplete = false var body: some View { NavigationStack { @@ -94,9 +98,18 @@ struct FilesView: View { .frame(height: 44) } .task { - if !initialLoad { + if !initialLoadComplete { let _ = await model.getFileList() - initialLoad = true + initialLoadComplete = true + } + } + .overlay { + if !initialLoadComplete { + VStack { + ProgressView() + .controlSize(.large) + } + .frame(maxWidth: .infinity) } } .listStyle(.plain) |