Skip to content

Commit

Permalink
Update widget on widget-entry-changes (#2426)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Dec 12, 2024
1 parent 5b804b2 commit d729fb4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deltachat-ios/Controller/FilesViewController.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIKit
import DcCore
import LinkPresentation
import WidgetKit

class FilesViewController: UIViewController {

Expand Down Expand Up @@ -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) {
Expand All @@ -338,6 +342,9 @@ extension FilesViewController {
entries.removeAll { $0 == entry }

dcContext.storeShownWidgets(entries)
if #available(iOS 15.0, *) {
WidgetCenter.shared.reloadTimelines(ofKind: "DcWebxdcWidget")
}
}
}

Expand Down

0 comments on commit d729fb4

Please sign in to comment.