diff --git a/Sources/AppCore/Models/HUDModel.swift b/Sources/AppCore/Models/HUDModel.swift index 8d2679e6e870fa7507d8593ae683ee3b76ab0fcb..5e4435988f7660984355241cefea0fbe40f921aa 100644 --- a/Sources/AppCore/Models/HUDModel.swift +++ b/Sources/AppCore/Models/HUDModel.swift @@ -14,6 +14,7 @@ public struct HUDModel { content: String? = nil, actionTitle: String? = nil, hasDotAnimation: Bool = false, + isAutoDismissable: Bool = false, onTapClosure: (() -> Void)? = nil ) { self.title = title @@ -21,7 +22,7 @@ public struct HUDModel { self.actionTitle = actionTitle self.onTapClosure = onTapClosure self.hasDotAnimation = hasDotAnimation - self.isAutoDismissable = onTapClosure == nil && !hasDotAnimation + self.isAutoDismissable = isAutoDismissable } public init( diff --git a/Sources/AppCore/RootViewController.swift b/Sources/AppCore/RootViewController.swift index 2c794a01704c45e4f0e234c736b8b1e4fed8321e..fbeebe5ef3971d9add68f6c1b09dc585380dab43 100644 --- a/Sources/AppCore/RootViewController.swift +++ b/Sources/AppCore/RootViewController.swift @@ -68,6 +68,7 @@ public final class RootViewController: UIViewController { return } add(hudView: HUDView().setup(model: model)) + view.endEditing(true) }.store(in: &cancellables) } } diff --git a/Sources/SearchFeature/ViewModels/SearchLeftViewModel.swift b/Sources/SearchFeature/ViewModels/SearchLeftViewModel.swift index 9a9aacb84b1b125233beb46f38601296a4f7df6d..e4249b8bff0fa6271a0f7aabf17270e4f0150969 100644 --- a/Sources/SearchFeature/ViewModels/SearchLeftViewModel.swift +++ b/Sources/SearchFeature/ViewModels/SearchLeftViewModel.swift @@ -66,6 +66,7 @@ final class SearchLeftViewModel { hudManager.show(.init( actionTitle: Localized.Ud.Search.cancel, hasDotAnimation: true, + isAutoDismissable: false, onTapClosure: { [weak self] in guard let self else { return } self.didTapCancelSearch() @@ -114,6 +115,7 @@ final class SearchLeftViewModel { hudManager.show(.init( actionTitle: Localized.Ud.Search.cancel, hasDotAnimation: true, + isAutoDismissable: false, onTapClosure: { [weak self] in guard let self else { return } self.didTapCancelSearch()