fixed weird crash bug on half drag back on playlist view
This commit is contained in:
parent
fced8c9fc3
commit
228fdb3991
@ -13,8 +13,6 @@ import SwiftUICharts
|
|||||||
|
|
||||||
struct PlaylistView: View {
|
struct PlaylistView: View {
|
||||||
|
|
||||||
@EnvironmentObject var liveUser: LiveUser
|
|
||||||
|
|
||||||
@Binding var playlist: Playlist
|
@Binding var playlist: Playlist
|
||||||
|
|
||||||
@State private var this_month: Bool = false
|
@State private var this_month: Bool = false
|
||||||
@ -194,11 +192,19 @@ struct PlaylistView: View {
|
|||||||
Text("Open")
|
Text("Open")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// alert seems to need to be within list root element
|
||||||
|
// else weird crash on half drag back
|
||||||
|
.alert(isPresented: $showingNetworkError) {
|
||||||
|
Alert(title: Text("Network Error"),
|
||||||
|
message: Text("Could not refresh playlist"))
|
||||||
|
}
|
||||||
|
|
||||||
}.listStyle(GroupedListStyle())
|
}.listStyle(GroupedListStyle())
|
||||||
.pullToRefresh(isShowing: $isRefreshing) {
|
.pullToRefresh(isShowing: $isRefreshing) {
|
||||||
self.refreshPlaylist()
|
self.refreshPlaylist()
|
||||||
}
|
}
|
||||||
.navigationBarTitle(playlist.name)
|
.navigationBarTitle(Text(playlist.name))
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
|
||||||
// TODO are these binding properly?
|
// TODO are these binding properly?
|
||||||
@ -212,10 +218,6 @@ struct PlaylistView: View {
|
|||||||
self.$chart_limit.wrappedValue = playlist.chart_limit
|
self.$chart_limit.wrappedValue = playlist.chart_limit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.alert(isPresented: $showingNetworkError) {
|
|
||||||
Alert(title: Text("Network Error"),
|
|
||||||
message: Text("Could not refresh playlist"))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func changeChartRange(newRange: LastFmRange) {
|
func changeChartRange(newRange: LastFmRange) {
|
||||||
|
Loading…
Reference in New Issue
Block a user