From 9fede7e4674bb0b5363567366a33408095569c86 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Wed, 26 Feb 2025 12:42:31 -0800 Subject: [PATCH] Use ms-winsoundevent:Notification.IM on Windows --- app/renderWindowsToast.tsx | 5 ++ ts/test-node/app/renderWindowsToast_test.tsx | 76 ++++++++++++++++---- 2 files changed, 69 insertions(+), 12 deletions(-) diff --git a/app/renderWindowsToast.tsx b/app/renderWindowsToast.tsx index 3d3e0ccb6c..dbf9d35fa1 100644 --- a/app/renderWindowsToast.tsx +++ b/app/renderWindowsToast.tsx @@ -33,6 +33,7 @@ const Text = (props: { id: string; children: React.ReactNode }) => React.createElement('text', props); const Image = (props: { id: string; src: string; 'hint-crop': string }) => React.createElement('image', props); +const Audio = (props: { src: string }) => React.createElement('audio', props); export function renderWindowsToast({ avatarPath, @@ -51,6 +52,8 @@ export function renderWindowsToast({ const template = avatarPath ? 'ToastImageAndText02' : 'ToastText02'; let launch: URL; + let audio: React.ReactNode | undefined; + // Note: // 1) this maps to the notify() function in services/notifications.ts // 2) this also maps to the url-handling in main.ts @@ -58,6 +61,7 @@ export function renderWindowsToast({ launch = showConversationRoute.toAppUrl({ token, }); + audio =