Add sound effect for notifications in Linux

This commit is contained in:
Evan Hahn 2020-09-11 16:23:11 -05:00 committed by Josh Perez
parent 6d2e994f9f
commit de66486e41
7 changed files with 146 additions and 234 deletions

View file

@ -1,7 +1,6 @@
interface Environment {
isAppFocused: boolean;
isAudioNotificationEnabled: boolean;
isAudioNotificationSupported: boolean;
isEnabled: boolean;
hasNotifications: boolean;
userSetting: UserSetting;
@ -26,7 +25,6 @@ type Type =
export const getStatus = ({
isAppFocused,
isAudioNotificationEnabled,
isAudioNotificationSupported,
isEnabled,
hasNotifications,
userSetting,
@ -51,15 +49,10 @@ export const getStatus = ({
return 'ok';
})();
const shouldPlayNotificationSound =
isAudioNotificationSupported && isAudioNotificationEnabled;
const shouldShowNotifications = type === 'ok';
const shouldClearNotifications = type === 'appIsFocused';
return {
shouldClearNotifications,
shouldPlayNotificationSound,
shouldShowNotifications,
shouldClearNotifications: type === 'appIsFocused',
shouldPlayNotificationSound: isAudioNotificationEnabled,
shouldShowNotifications: type === 'ok',
type,
};
};