ios cleanup and fix

This commit is contained in:
Ethan Pippin 2022-01-06 11:12:24 -07:00
parent bfe557c86c
commit e170e0671e
3 changed files with 1 additions and 36 deletions

View File

@ -68,7 +68,7 @@ struct HomeView: View {
ForEach(viewModel.libraries, id: \.self) { library in ForEach(viewModel.libraries, id: \.self) { library in
LatestMediaView(viewModel: LatestMediaViewModel(libraryID: library.id!)) { LatestMediaView(viewModel: LatestMediaViewModel(library: library)) {
HStack { HStack {
Text(L10n.latestWithString(library.name ?? "")) Text(L10n.latestWithString(library.name ?? ""))
.font(.title2) .font(.title2)

View File

@ -51,24 +51,6 @@ private struct ItemView: View {
} }
} }
@ViewBuilder
var toolbarItemContent: some View {
switch viewModel.item.itemType {
case .season:
Menu {
Button {
(viewModel as? SeasonItemViewModel)?.routeToSeriesItem()
} label: {
Label("Show Series", systemImage: "text.below.photo")
}
} label: {
Image(systemName: "ellipsis.circle.fill")
}
default:
EmptyView()
}
}
var body: some View { var body: some View {
Group { Group {
if hSizeClass == .compact && vSizeClass == .regular { if hSizeClass == .compact && vSizeClass == .regular {
@ -79,10 +61,5 @@ private struct ItemView: View {
.environmentObject(viewModel) .environmentObject(viewModel)
} }
} }
.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
toolbarItemContent
}
}
} }
} }

View File

@ -73,18 +73,6 @@ final class SeasonItemViewModel: ItemViewModel {
} }
} }
func routeToSeriesItem() {
guard let id = item.seriesId else { return }
UserLibraryAPI.getItem(userId: SessionManager.main.currentLogin.user.id, itemId: id)
.trackActivity(loading)
.sink(receiveCompletion: { [weak self] completion in
self?.handleAPIRequestError(completion: completion)
}, receiveValue: { [weak self] item in
self?.itemRouter?.route(to: \.item, item)
})
.store(in: &cancellables)
}
private func getSeriesItem() { private func getSeriesItem() {
guard let seriesID = item.seriesId else { return } guard let seriesID = item.seriesId else { return }
UserLibraryAPI.getItem(userId: SessionManager.main.currentLogin.user.id, UserLibraryAPI.getItem(userId: SessionManager.main.currentLogin.user.id,