Skip to content

Commit 2512af8

Browse files
committed
fix: fix touchbar icon
- fix #2183
1 parent 8879799 commit 2512af8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/plugins/touchbar/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { type NativeImage, TouchBar } from 'electron';
1+
import { nativeImage, type NativeImage, TouchBar } from 'electron';
22

33
import { createPlugin } from '@/utils';
44
import getSongControls from '@/providers/song-controls';
55
import registerCallback from '@/providers/song-info';
66
import { t } from '@/i18n';
77

8+
import youtubeMusicIcon from '@assets/youtube-music.png?asset&asarUnpack';
9+
810
export default createPlugin({
911
name: () => t('plugins.touchbar.name'),
1012
description: () => t('plugins.touchbar.description'),
@@ -89,9 +91,9 @@ export default createPlugin({
8991
pausePlayButton.label = songInfo.isPaused ? '▶️' : '⏸';
9092

9193
// Get image source
92-
songImage.icon = songInfo.image
93-
? songInfo.image.resize({ height: 23 })
94-
: undefined;
94+
songImage.icon = (
95+
songInfo.image ? songInfo.image : nativeImage.createFromPath(youtubeMusicIcon)
96+
).resize({ height: 23 });
9597

9698
window.setTouchBar(touchBar);
9799
});

0 commit comments

Comments
 (0)