Skip to content

Commit 3f5cd2c

Browse files
committed
fix(desktop): audio stuff
1 parent a160eb7 commit 3f5cd2c

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

packages/desktop/src/context/notification.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ type ErrorNotification = NotificationBase & {
2525

2626
export type Notification = TurnCompleteNotification | ErrorNotification
2727

28-
export type AudioSettings = {
29-
enabled: boolean
30-
volume: number
31-
}
32-
3328
export const { use: useNotification, provider: NotificationProvider } = createSimpleContext({
3429
name: "Notification",
3530
init: () => {
@@ -39,10 +34,6 @@ export const { use: useNotification, provider: NotificationProvider } = createSi
3934
const [store, setStore] = makePersisted(
4035
createStore({
4136
list: [] as Notification[],
42-
audio: {
43-
enabled: true,
44-
volume: 1,
45-
} as AudioSettings,
4637
}),
4738
{
4839
name: "notification.v1",
@@ -64,10 +55,7 @@ export const { use: useNotification, provider: NotificationProvider } = createSi
6455
}
6556
switch (event.type) {
6657
case "session.idle": {
67-
if (store.audio.enabled) {
68-
idlePlayer.setVolume(store.audio.volume)
69-
idlePlayer.play()
70-
}
58+
idlePlayer.play()
7159
const session = event.properties.sessionID
7260
setStore("list", store.list.length, {
7361
...base,
@@ -113,18 +101,6 @@ export const { use: useNotification, provider: NotificationProvider } = createSi
113101
setStore("list", (n) => n.directory === directory, "viewed", true)
114102
},
115103
},
116-
audio: {
117-
get settings() {
118-
return store.audio
119-
},
120-
setEnabled(enabled: boolean) {
121-
setStore("audio", "enabled", enabled)
122-
},
123-
setVolume(volume: number) {
124-
const clamped = Math.max(0, Math.min(1, volume))
125-
setStore("audio", "volume", clamped)
126-
},
127-
},
128104
}
129105
},
130106
})

0 commit comments

Comments
 (0)