From d729fb4c702193afdbe0522238db38ba5b6e590a Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Thu, 12 Dec 2024 16:47:03 +0100 Subject: [PATCH] Update widget on widget-entry-changes (#2426) --- deltachat-ios/Controller/FilesViewController.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deltachat-ios/Controller/FilesViewController.swift b/deltachat-ios/Controller/FilesViewController.swift index 032ed9693..37090e67f 100644 --- a/deltachat-ios/Controller/FilesViewController.swift +++ b/deltachat-ios/Controller/FilesViewController.swift @@ -1,6 +1,7 @@ import UIKit import DcCore import LinkPresentation +import WidgetKit class FilesViewController: UIViewController { @@ -330,6 +331,9 @@ extension FilesViewController { entries.insert(entry, at: entries.startIndex) dcContext.storeShownWidgets(entries) + if #available(iOS 15.0, *) { + WidgetCenter.shared.reloadTimelines(ofKind: "DcWebxdcWidget") + } } func removeFromHomescreen(messageId: Int) { @@ -338,6 +342,9 @@ extension FilesViewController { entries.removeAll { $0 == entry } dcContext.storeShownWidgets(entries) + if #available(iOS 15.0, *) { + WidgetCenter.shared.reloadTimelines(ofKind: "DcWebxdcWidget") + } } }