From 9768e3d830a25473fad0f2594544a918b92d2218 Mon Sep 17 00:00:00 2001 From: ant013 Date: Wed, 13 Dec 2023 14:53:38 +0600 Subject: [PATCH] Update widgets on willEnterForeground --- .../UnstoppableWallet/Core/Managers/AppManager.swift | 3 +++ UnstoppableWallet/Widget/AppWidgetConstants.swift | 2 ++ 2 files changed, 5 insertions(+) diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Managers/AppManager.swift b/UnstoppableWallet/UnstoppableWallet/Core/Managers/AppManager.swift index ce438cf3cb..d1aa4aed19 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Managers/AppManager.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Managers/AppManager.swift @@ -1,6 +1,7 @@ import Foundation import RxSwift import UIKit +import WidgetKit class AppManager { private let accountManager: AccountManager @@ -108,6 +109,8 @@ extension AppManager { walletConnectSocketConnectionService.willEnterForeground() nftMetadataSyncer.sync() + + AppWidgetConstants.allKinds.forEach { WidgetCenter.shared.reloadTimelines(ofKind: $0) } } func willTerminate() { diff --git a/UnstoppableWallet/Widget/AppWidgetConstants.swift b/UnstoppableWallet/Widget/AppWidgetConstants.swift index 5fe71776b2..b5ad23b417 100644 --- a/UnstoppableWallet/Widget/AppWidgetConstants.swift +++ b/UnstoppableWallet/Widget/AppWidgetConstants.swift @@ -1,4 +1,6 @@ enum AppWidgetConstants { + static let allKinds = [singleCoinPriceWidgetKind, topCoinsWidgetKind, watchlistWidgetKind] + static let singleCoinPriceWidgetKind: String = "io.horizontalsystems.unstoppable.SingleCoinPriceWidget" static let topCoinsWidgetKind: String = "io.horizontalsystems.unstoppable.TopCoinsWidget" static let watchlistWidgetKind: String = "io.horizontalsystems.unstoppable.WatchlistWidget"