From 4e6798e83ece710d7ba4ed0f32e6919ccb69bc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 16 Sep 2024 02:55:19 +0200 Subject: [PATCH] InfoBarCoordinator as ResponseRouterCoordinator --- .../FlowPilotInfoBar/InfoBarCoordinator.swift | 24 +++---------------- .../InfoBarWindowRouter.swift | 2 +- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/Sources/FlowPilotInfoBar/InfoBarCoordinator.swift b/Sources/FlowPilotInfoBar/InfoBarCoordinator.swift index 5978587..e45c17f 100644 --- a/Sources/FlowPilotInfoBar/InfoBarCoordinator.swift +++ b/Sources/FlowPilotInfoBar/InfoBarCoordinator.swift @@ -6,12 +6,12 @@ // import Foundation -import CleevioRouters +import FlowPilot import SwiftUI import CleevioCore #if canImport(UIKit) -open class InfoBarCoordinator: ResponseRouterCoordinator { +open class InfoBarCoordinator: ResponseRouterCoordinator { let frame: CGRect let content: InfoBarContent let viewModel: InfoBarViewModel @@ -48,30 +48,12 @@ open class InfoBarCoordinator: ResponseRouter .filter { !$0 } .delay(for: 0.1, scheduler: DispatchQueue.main) .sink(receiveValue: { [weak self] _ in + self?.response(with: ()) self?.dismiss() }) .store(in: cancelBag) present(viewController, animated: animated) } - - open func startAndWaitForDismiss() async { - start() - var shouldCallContinuation = true - - await withCheckedContinuation { continuation in - viewModel.$isMessageShown - .dropFirst() - .filter { !$0 } - .delay(for: 0.1, scheduler: DispatchQueue.main) - .sink(receiveValue: { _ in - if shouldCallContinuation { - shouldCallContinuation = false - continuation.resume() - } - }) - .store(in: cancelBag) - } - } } #endif diff --git a/Sources/FlowPilotInfoBar/InfoBarWindowRouter.swift b/Sources/FlowPilotInfoBar/InfoBarWindowRouter.swift index 4199357..f765990 100644 --- a/Sources/FlowPilotInfoBar/InfoBarWindowRouter.swift +++ b/Sources/FlowPilotInfoBar/InfoBarWindowRouter.swift @@ -6,7 +6,7 @@ // import Foundation -import CleevioRouters +import FlowPilot import CleevioUI #if canImport(UIKit)