Skip to content

Open source CapCut alternative.

TypeScript

fix(app): load the menu bar icon through DonkeyResourceBundle [rebuild]

David Le789bc5d9b4d9
diff --git a/apps/Donkey/Sources/Donkey/DonkeyStatusItemController.swift b/apps/Donkey/Sources/Donkey/DonkeyStatusItemController.swift
index bb6be615..aaae8e9c 100644
--- a/apps/Donkey/Sources/Donkey/DonkeyStatusItemController.swift
+++ b/apps/Donkey/Sources/Donkey/DonkeyStatusItemController.swift
@@ -1,5 +1,6 @@
import AppKit
import DonkeyContracts
+import DonkeyRuntime
/// The menu bar entry point: a status item with the Donkey glyph whose menu follows the
/// session — "Go to App" and "Log out" while signed in, "Log in" while signed out — plus an
@@ -117,7 +118,7 @@ final class DonkeyStatusItemController: NSObject, NSMenuDelegate {
private static func menuBarIcon() -> NSImage {
let image = NSImage(size: NSSize(width: 20, height: 20))
for resource in ["menu-bar-icon", "menu-bar-icon@2x"] {
- guard let url = Bundle.module.url(forResource: resource, withExtension: "png"),
+ guard let url = DonkeyResourceBundle.app?.url(forResource: resource, withExtension: "png"),
let data = try? Data(contentsOf: url),
let representation = NSBitmapImageRep(data: data) else { continue }
representation.size = image.size