mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 20:03:25 +01:00
Add sound effect for notifications in Linux
This commit is contained in:
@@ -2,8 +2,23 @@ import * as OS from '../OS';
|
||||
|
||||
const MIN_WINDOWS_VERSION = '8.0.0';
|
||||
|
||||
export const isAudioNotificationSupported = () =>
|
||||
OS.isWindows(MIN_WINDOWS_VERSION) || OS.isMacOS();
|
||||
export enum AudioNotificationSupport {
|
||||
None,
|
||||
Native,
|
||||
Custom,
|
||||
}
|
||||
|
||||
export function getAudioNotificationSupport(): AudioNotificationSupport {
|
||||
if (OS.isWindows(MIN_WINDOWS_VERSION) || OS.isMacOS()) {
|
||||
return AudioNotificationSupport.Native;
|
||||
} else if (OS.isLinux()) {
|
||||
return AudioNotificationSupport.Custom;
|
||||
}
|
||||
return AudioNotificationSupport.None;
|
||||
}
|
||||
|
||||
export const isAudioNotificationSupported = (): boolean =>
|
||||
getAudioNotificationSupport() !== AudioNotificationSupport.None;
|
||||
|
||||
// Using `Notification::tag` has a bug on Windows 7:
|
||||
// https://github.com/electron/electron/issues/11189
|
||||
|
||||
Reference in New Issue
Block a user