From a5a6034ea690ace90f02f313cb7fcd2ecf020d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20Cisin=CC=81ski?= Date: Thu, 21 Mar 2024 21:39:20 +0100 Subject: [PATCH] TF-1527 Fix for missing Add icon --- .../Interactors/LocalNotificationStateInteractor.swift | 4 +++- TwoFAS/Data/Interactors/NewsInteractor.swift | 1 + .../Modules/Tokens/Presenter/TokensPresenter.swift | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/TwoFAS/Data/Interactors/LocalNotificationStateInteractor.swift b/TwoFAS/Data/Interactors/LocalNotificationStateInteractor.swift index 25b9296a..a02cfab6 100644 --- a/TwoFAS/Data/Interactors/LocalNotificationStateInteractor.swift +++ b/TwoFAS/Data/Interactors/LocalNotificationStateInteractor.swift @@ -72,6 +72,7 @@ extension LocalNotificationStateInteractor: LocalNotificationStateInteracting { if runCount >= 2 && cycle == -2 { startNotification(-1) + markLocalNotificationsAsHandled() return } @@ -107,7 +108,8 @@ extension LocalNotificationStateInteractor: LocalNotificationStateInteracting { setInactiveNotification(next) } markLocalNotificationsAsHandled() - default: break + default: + markLocalNotificationsAsHandled() } } } diff --git a/TwoFAS/Data/Interactors/NewsInteractor.swift b/TwoFAS/Data/Interactors/NewsInteractor.swift index 46fd9097..6f005e78 100644 --- a/TwoFAS/Data/Interactors/NewsInteractor.swift +++ b/TwoFAS/Data/Interactors/NewsInteractor.swift @@ -72,6 +72,7 @@ extension NewsInteractor: NewsInteracting { network.fetchNews { [weak self] result in switch result { case .success(let newList): + Log("NewsInteractor: News list fetched, items count: \(newList.count)", module: .moduleInteractor) self?.mainRepository.saveLastNewsFetch(Date()) self?.handleFetchedList(newList) case .failure: diff --git a/TwoFAS/TwoFAS/Root/Modules/Tokens/Presenter/TokensPresenter.swift b/TwoFAS/TwoFAS/Root/Modules/Tokens/Presenter/TokensPresenter.swift index 5fe5553f..92a7489d 100644 --- a/TwoFAS/TwoFAS/Root/Modules/Tokens/Presenter/TokensPresenter.swift +++ b/TwoFAS/TwoFAS/Root/Modules/Tokens/Presenter/TokensPresenter.swift @@ -86,9 +86,7 @@ extension TokensPresenter { Log("TokensPresenter - viewWillAppear") interactor.sync() appActiveActions() - interactor.fetchNews { [weak self] in - self?.updateNewsIcon() - } + updateNewsIcon() } func handleAppDidBecomeActive() { @@ -453,6 +451,7 @@ extension TokensPresenter { private extension TokensPresenter { func appActiveActions() { updateEditStateButton() + updateNewsIcon() changeDragAndDropIfNecessary(enable: false) changeRequriesTokenRefresh = true reloadData() @@ -532,7 +531,7 @@ private extension TokensPresenter { }() if interactor.hasServices { - updateNewsIcon() + updateAddServiceIcon() view?.showList() if Set(currentServices) != Set(newServices) || changeRequriesTokenRefresh { @@ -553,7 +552,7 @@ private extension TokensPresenter { if !isSearching && currentState == .edit { setCurrentState(.normal) } - updateNewsIcon() + updateAddServiceIcon() interactor.stopCounters() updateEditStateButton() @@ -596,6 +595,7 @@ private extension TokensPresenter { } func updateNewsIcon() { + updateAddServiceIcon() interactor.fetchNews { [weak self] in self?.updateAddServiceIcon() }