mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-21 15:50:59 +00:00
Change visibility logic
This commit is contained in:
parent
d6b4a7eabd
commit
c10934f32b
2 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ import UIKit
|
||||||
import ViewModels
|
import ViewModels
|
||||||
|
|
||||||
extension UIViewController {
|
extension UIViewController {
|
||||||
var isVisible: Bool { isViewLoaded && view.window != nil && presentedViewController == nil }
|
var isVisible: Bool { isViewLoaded && view.window != nil }
|
||||||
|
|
||||||
func present(alertItem: AlertItem) {
|
func present(alertItem: AlertItem) {
|
||||||
let alertController = UIAlertController(
|
let alertController = UIAlertController(
|
||||||
|
|
|
@ -423,7 +423,7 @@ private extension TableViewController {
|
||||||
viewModel.alertItems
|
viewModel.alertItems
|
||||||
.compactMap { $0 }
|
.compactMap { $0 }
|
||||||
.sink { [weak self] in
|
.sink { [weak self] in
|
||||||
guard let self = self, self.isVisible else { return }
|
guard let self = self, self.isVisible, self.presentedViewController == nil else { return }
|
||||||
|
|
||||||
self.present(alertItem: $0)
|
self.present(alertItem: $0)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue