fix: fix touchbar icon

- fix #2183
This commit is contained in:
JellyBrick
2024-07-14 23:19:06 +09:00
parent 887979932c
commit 2512af80af

View File

@ -1,10 +1,12 @@
import { type NativeImage, TouchBar } from 'electron';
import { nativeImage, type NativeImage, TouchBar } from 'electron';
import { createPlugin } from '@/utils';
import getSongControls from '@/providers/song-controls';
import registerCallback from '@/providers/song-info';
import { t } from '@/i18n';
import youtubeMusicIcon from '@assets/youtube-music.png?asset&asarUnpack';
export default createPlugin({
name: () => t('plugins.touchbar.name'),
description: () => t('plugins.touchbar.description'),
@ -89,9 +91,9 @@ export default createPlugin({
pausePlayButton.label = songInfo.isPaused ? '▶️' : '⏸';
// Get image source
songImage.icon = songInfo.image
? songInfo.image.resize({ height: 23 })
: undefined;
songImage.icon = (
songInfo.image ? songInfo.image : nativeImage.createFromPath(youtubeMusicIcon)
).resize({ height: 23 });
window.setTouchBar(touchBar);
});