Skip to content
Open
Changes from 1 commit
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
12 changes: 10 additions & 2 deletions apps/web/src/pages/Connections/useConnections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ export function useConnections() {
if (conn?.meshDeviceId) {
try {
useDeviceStore.getState().removeDevice(conn.meshDeviceId);
} catch {}
} catch (err) {
log.warn("removeDevice failed during removeConnection", {
id,
meshDeviceId: conn.meshDeviceId,
err,
});
}
Comment on lines +91 to +97
}
meshRegistry.unregister(id);
removeSavedConnectionFromStore(id);
Expand Down Expand Up @@ -249,7 +255,9 @@ export function useConnections() {
// Read from the live store, not the memoized `connections` closure: callers
// such as addConnectionAndConnect() add a connection and connect to it in the
// same tick, before this hook re-renders, so the closure would be stale.
const conn = useDeviceStore.getState().savedConnections.find((c) => c.id === id);
const conn = useDeviceStore
.getState()
.savedConnections.find((c) => c.id === id);
if (!conn) {
log.warn("connect: unknown connection id", { id });
return false;
Expand Down
Loading