mirror of
				https://github.com/yattee/yattee.git
				synced 2025-11-04 06:32:03 +00:00 
			
		
		
		
	Fix retry video buttons
This commit is contained in:
		@@ -314,16 +314,27 @@ extension PlayerModel {
 | 
			
		||||
            message += errorString
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        let alert = Alert(
 | 
			
		||||
            title: Text("Could not load video"),
 | 
			
		||||
            message: Text(message),
 | 
			
		||||
            primaryButton: .cancel(),
 | 
			
		||||
            secondaryButton: .default(Text("Retry")) { [weak self] in
 | 
			
		||||
                if let self, let video = video {
 | 
			
		||||
        var retryButton: Alert.Button?
 | 
			
		||||
 | 
			
		||||
        if let video {
 | 
			
		||||
            retryButton = Alert.Button.default(Text("Retry")) { [weak self] in
 | 
			
		||||
                if let self {
 | 
			
		||||
                    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)
 | 
			
		||||
        advancing = false
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user