Skip to content

Commit

Permalink
consider PR-feedback (#2406)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Dec 17, 2024
1 parent c4a2bef commit a526b41
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 300 deletions.
15 changes: 2 additions & 13 deletions DcWebxdcWidget/DcWebxdcWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,11 @@ struct Provider: TimelineProvider {

func getTimeline(in context: Context, completion: @escaping (Timeline<Entry>) -> Void) {
/// ----------------------------------
/// **DO NOT** START dcAccounts.startIo() IN WIDGET
/// **DO NOT** start dcAccounts.startIo() in widget.
/// This works only for one process, and widgets may run concurrently to the main app in their own process.
/// ----------------------------------
let dcAccounts = DcAccounts.shared
dcAccounts.openDatabase(writeable: false)
for accountId in dcAccounts.getAll() {
let dcContext = dcAccounts.get(id: accountId)
if dcContext.isOpen() == false {
do {
let secret = try KeychainManager.getAccountSecret(accountID: accountId)
_ = dcContext.open(passphrase: secret)
} catch {
debugPrint("Couldn't open \(error.localizedDescription)")
}
}
}

let dcContext = dcAccounts.getSelected()
let chatId = 0
let ignore = Int32(0)
Expand Down
Loading

0 comments on commit a526b41

Please sign in to comment.