show macOS warning one, don't show artist link if invalid

This commit is contained in:
Kendall Garner 2024-04-17 22:44:35 -07:00
parent 5d6503c1f4
commit ebd2f07447
No known key found for this signature in database
GPG key ID: 18D2767419676C87
2 changed files with 29 additions and 18 deletions

View file

@ -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);
}
}