From ebd2f07447ae5178eb3ee8b7418cfdea4db03f70 Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Wed, 17 Apr 2024 22:44:35 -0700 Subject: [PATCH] show macOS warning one, don't show artist link if invalid --- src/main/features/core/player/media-keys.ts | 4 +- .../components/item-details-modal.tsx | 43 +++++++++++-------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/main/features/core/player/media-keys.ts b/src/main/features/core/player/media-keys.ts index bac8c2ca..b87f9ee1 100644 --- a/src/main/features/core/player/media-keys.ts +++ b/src/main/features/core/player/media-keys.ts @@ -6,18 +6,20 @@ import { store } from '../settings'; export const enableMediaKeys = (window: BrowserWindow | null) => { if (isMacOS()) { const shouldPrompt = store.get('should_prompt_accessibility', true) as boolean; + const shownWarning = store.get('shown_accessibility_warning', false) as boolean; const trusted = systemPreferences.isTrustedAccessibilityClient(shouldPrompt); if (shouldPrompt) { store.set('should_prompt_accessibility', false); } - if (!trusted) { + if (!trusted && !shownWarning) { window?.webContents.send('toast-from-main', { message: 'Feishin is not a trusted accessibility client. Media keys will not work until this setting is changed', type: 'warning', }); + store.set('shown_accessibility_warning', true); } } diff --git a/src/renderer/features/item-details/components/item-details-modal.tsx b/src/renderer/features/item-details/components/item-details-modal.tsx index 7c0b1bde..ead11b46 100644 --- a/src/renderer/features/item-details/components/item-details-modal.tsx +++ b/src/renderer/features/item-details/components/item-details-modal.tsx @@ -48,24 +48,33 @@ const handleRow = (t: TFunction, item: T, rule: ItemDe const formatArtists = (isAlbumArtist: boolean) => (item: Album | Song) => (isAlbumArtist ? item.albumArtists : item.artists)?.map((artist, index) => ( - + {index > 0 && } - - {artist.name || '—'} - + {artist.id ? ( + + {artist.name || '—'} + + ) : ( + + {artist.name || '-'} + + )} ));