iOS/iPadOS - Media/LibraryView Loading Indicator (#556)
This commit is contained in:
parent
79476328fe
commit
14f1219500
|
@ -37,6 +37,7 @@ final class MediaViewModel: ViewModel {
|
||||||
|
|
||||||
func requestLibraries() {
|
func requestLibraries() {
|
||||||
UserViewsAPI.getUserViews(userId: SessionManager.main.currentLogin.user.id)
|
UserViewsAPI.getUserViews(userId: SessionManager.main.currentLogin.user.id)
|
||||||
|
.trackActivity(loading)
|
||||||
.sink(receiveCompletion: { completion in
|
.sink(receiveCompletion: { completion in
|
||||||
self.handleAPIRequestError(completion: completion)
|
self.handleAPIRequestError(completion: completion)
|
||||||
}, receiveValue: { response in
|
}, receiveValue: { response in
|
||||||
|
|
|
@ -116,6 +116,11 @@ struct LibraryView: View {
|
||||||
}
|
}
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItemGroup(placement: .navigationBarTrailing) {
|
ToolbarItemGroup(placement: .navigationBarTrailing) {
|
||||||
|
|
||||||
|
if viewModel.isLoading && !viewModel.items.isEmpty {
|
||||||
|
ProgressView()
|
||||||
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
switch libraryViewType {
|
switch libraryViewType {
|
||||||
case .grid:
|
case .grid:
|
||||||
|
|
|
@ -69,5 +69,12 @@ struct MediaView: View {
|
||||||
}
|
}
|
||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
.navigationTitle(L10n.allMedia)
|
.navigationTitle(L10n.allMedia)
|
||||||
|
.toolbar {
|
||||||
|
ToolbarItemGroup(placement: .navigationBarTrailing) {
|
||||||
|
if viewModel.isLoading {
|
||||||
|
ProgressView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue