فهرست منبع

fix: defensive audio init

Adam 2 ماه پیش
والد
کامیت
5eeba76bc5
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      packages/desktop/src/context/notification.tsx

+ 6 - 2
packages/desktop/src/context/notification.tsx

@@ -68,7 +68,9 @@ export const { use: useNotification, provider: NotificationProvider } = createSi
           const match = Binary.search(syncStore.session, sessionID, (s) => s.id)
           const isChild = match.found && syncStore.session[match.index].parentID
           if (isChild) break
-          idlePlayer?.play()
+          try {
+            idlePlayer?.play()
+          } catch {}
           setStore("list", store.list.length, {
             ...base,
             type: "turn-complete",
@@ -84,7 +86,9 @@ export const { use: useNotification, provider: NotificationProvider } = createSi
             const isChild = match.found && syncStore.session[match.index].parentID
             if (isChild) break
           }
-          errorPlayer?.play()
+          try {
+            errorPlayer?.play()
+          } catch {}
           setStore("list", store.list.length, {
             ...base,
             type: "error",