mirror of
https://github.com/jeffvli/feishin.git
synced 2024-11-20 14:37:06 +01:00
show macOS warning one, don't show artist link if invalid
This commit is contained in:
parent
5d6503c1f4
commit
ebd2f07447
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,9 @@ const handleRow = <T extends AnyLibraryItem>(t: TFunction, item: T, rule: ItemDe
|
||||
|
||||
const formatArtists = (isAlbumArtist: boolean) => (item: Album | Song) =>
|
||||
(isAlbumArtist ? item.albumArtists : item.artists)?.map((artist, index) => (
|
||||
<span key={artist.id}>
|
||||
<span key={artist.id || artist.name}>
|
||||
{index > 0 && <Separator />}
|
||||
{artist.id ? (
|
||||
<Text
|
||||
$link
|
||||
component={Link}
|
||||
@ -66,6 +67,14 @@ const formatArtists = (isAlbumArtist: boolean) => (item: Album | Song) =>
|
||||
>
|
||||
{artist.name || '—'}
|
||||
</Text>
|
||||
) : (
|
||||
<Text
|
||||
overflow="visible"
|
||||
size="md"
|
||||
>
|
||||
{artist.name || '-'}
|
||||
</Text>
|
||||
)}
|
||||
</span>
|
||||
));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user