From 6b30e804c0589e9ad36ad5c3d7f255076cb330fc Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 16 Dec 2022 12:32:43 +0100 Subject: [PATCH] Don't close video on error alert until dismissed --- Model/Player/PlayerQueue.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Model/Player/PlayerQueue.swift b/Model/Player/PlayerQueue.swift index 5019aa08..66861c09 100644 --- a/Model/Player/PlayerQueue.swift +++ b/Model/Player/PlayerQueue.swift @@ -338,7 +338,12 @@ extension PlayerModel { alert = Alert( title: Text("Could not load video"), message: Text(message), - primaryButton: .cancel(), + primaryButton: .cancel { [weak self] in + guard let self else { return } + self.advancing = false + self.videoBeingOpened = nil + self.currentItem = nil + }, secondaryButton: retryButton ) } else { @@ -346,8 +351,5 @@ extension PlayerModel { } navigation.presentAlert(alert) - advancing = false - videoBeingOpened = nil - currentItem = nil } }