Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/app/src/context/notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,14 @@ export const { use: useNotification, provider: NotificationProvider } = createSi

onCleanup(() => states.forEach((value) => value.dispose()))

const selected = () => ensure(activeServer())
const selected = () => {
const list = global.servers.list()
const key = activeServer()
if (list.some((conn) => ServerConnection.key(conn) === key)) return ensure(key)
const conn = list.find((conn) => ServerConnection.key(conn) === server.key) ?? list[0]
if (!conn) throw new Error("Notification server not found")
return ensure(ServerConnection.key(conn))
}

return {
ready: () => selected().ready(),
Expand Down
Loading