mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Fix retry video buttons
This commit is contained in:
parent
0f8c82bbca
commit
9bea3b623d
@ -314,16 +314,27 @@ extension PlayerModel {
|
|||||||
message += errorString
|
message += errorString
|
||||||
}
|
}
|
||||||
|
|
||||||
let alert = Alert(
|
var retryButton: Alert.Button?
|
||||||
title: Text("Could not load video"),
|
|
||||||
message: Text(message),
|
if let video {
|
||||||
primaryButton: .cancel(),
|
retryButton = Alert.Button.default(Text("Retry")) { [weak self] in
|
||||||
secondaryButton: .default(Text("Retry")) { [weak self] in
|
if let self {
|
||||||
if let self, let video = video {
|
|
||||||
self.enqueueVideo(video, play: true, prepending: true, loadDetails: true)
|
self.enqueueVideo(video, play: true, prepending: true, loadDetails: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
}
|
||||||
|
|
||||||
|
var alert: Alert
|
||||||
|
if let retryButton {
|
||||||
|
alert = Alert(
|
||||||
|
title: Text("Could not load video"),
|
||||||
|
message: Text(message),
|
||||||
|
primaryButton: .cancel(),
|
||||||
|
secondaryButton: retryButton
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
alert = Alert(title: Text("Could not load video"))
|
||||||
|
}
|
||||||
|
|
||||||
navigation.presentAlert(alert)
|
navigation.presentAlert(alert)
|
||||||
advancing = false
|
advancing = false
|
||||||
|
Loading…
Reference in New Issue
Block a user