diff --git a/lib/tunnelbroker/use-peer-to-peer-message-handler.js b/lib/tunnelbroker/use-peer-to-peer-message-handler.js --- a/lib/tunnelbroker/use-peer-to-peer-message-handler.js +++ b/lib/tunnelbroker/use-peer-to-peer-message-handler.js @@ -8,7 +8,10 @@ useBroadcastDeviceListUpdates, useGetAndUpdateDeviceListsForUsers, } from '../hooks/peer-list-hooks.js'; -import { getForeignPeerDevices } from '../selectors/user-selectors.js'; +import { + getAllPeerDevices, + getForeignPeerDevices, +} from '../selectors/user-selectors.js'; import { verifyAndGetDeviceList, removeDeviceFromDeviceList, @@ -40,6 +43,7 @@ const foreignPeerDevices = useSelector(getForeignPeerDevices); const broadcastDeviceListUpdates = useBroadcastDeviceListUpdates(); const getAndUpdateDeviceListsForUsers = useGetAndUpdateDeviceListsForUsers(); + const allPeerDevices = useSelector(getAllPeerDevices); return React.useCallback( async (message: PeerToPeerMessage, messageID: string) => { @@ -143,7 +147,9 @@ userID, deviceIDToLogOut, ); - // TODO: broadcast device list update here + await broadcastDeviceListUpdates( + allPeerDevices.filter(deviceID => deviceID !== deviceIDToLogOut), + ); } catch (e) { console.log(e); } @@ -257,6 +263,7 @@ identityClient, olmAPI, sqliteAPI, + allPeerDevices, ], ); }