Skip to content

Commit 8ff129e

Browse files
committed
Fix extension infinite loop
1 parent d404b5d commit 8ff129e

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

Shared/Channel/FinderCommChannel.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class FinderCommChannel {
1515
func setup() {
1616
let center = DistributedNotificationCenter.default()
1717
center.addObserver(self, selector: #selector(choosePermissionFolder(_:)), name: .init(rawValue: "ChoosePermissionFolder"), object: mainAppBundleID)
18-
center.addObserver(self, selector: #selector(refreshMenuItems(_:)), name: .init(rawValue: "RefreshMenuItems"), object: mainAppBundleID)
18+
// center.addObserver(self, selector: #selector(refreshMenuItems(_:)), name: .init(rawValue: "RefreshMenuItems"), object: mainAppBundleID)
1919
center.addObserver(self, selector: #selector(refreshFolderItems(_:)), name: .init(rawValue: "RefreshFolderItems"), object: mainAppBundleID)
2020
}
2121

@@ -44,13 +44,14 @@ class FinderCommChannel {
4444
send(name: "AppRefreshFolderItems", data: nil)
4545
}
4646
}
47-
48-
@MainActor @objc func refreshMenuItems(_ notification: Notification) {
49-
logger.notice("Refresh menu items")
50-
menuStore.refresh()
47+
48+
// Strange infinite loop, comment temporary since we drop sandbox support
49+
@objc func refreshMenuItems(_ notification: Notification) {
50+
// logger.notice("Refresh menu items")
51+
// menuStore.refresh()
5152
}
5253

53-
@MainActor @objc func refreshFolderItems(_ notification: Notification) {
54+
@objc func refreshFolderItems(_ notification: Notification) {
5455
logger.notice("Refresh folder items")
5556
folderStore.refresh()
5657
}

Shared/ViewModel/FolderItemStore.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@ final class FolderItemStore: Sendable {
1919

2020
// MARK: - Init
2121

22-
init() {
22+
nonisolated init() {
2323
Task {
2424
await MainActor.run {
2525
try? load()
2626
}
2727
}
2828
}
2929

30-
@MainActor func refresh() {
31-
try? load()
30+
nonisolated func refresh() {
31+
Task {
32+
await MainActor.run {
33+
try? load()
34+
}
35+
}
3236
}
3337

3438
// MARK: - Append Item

0 commit comments

Comments
 (0)