Skip to content

Commit

Permalink
Update widgets on willEnterForeground
Browse files Browse the repository at this point in the history
  • Loading branch information
ant013 committed Dec 13, 2023
1 parent 2860f94 commit 9768e3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import RxSwift
import UIKit
import WidgetKit

class AppManager {
private let accountManager: AccountManager
Expand Down Expand Up @@ -108,6 +109,8 @@ extension AppManager {
walletConnectSocketConnectionService.willEnterForeground()

nftMetadataSyncer.sync()

AppWidgetConstants.allKinds.forEach { WidgetCenter.shared.reloadTimelines(ofKind: $0) }
}

func willTerminate() {
Expand Down
2 changes: 2 additions & 0 deletions UnstoppableWallet/Widget/AppWidgetConstants.swift
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 9768e3d

Please sign in to comment.