atom.io 0.46.10 → 0.46.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -191,10 +191,17 @@ export function provideEnterAndExit({
191
191
  roomSocket.on(`joinRoom`, enterRoom)
192
192
  }
193
193
 
194
- editRelationsInStore(store, usersInRooms, (relations) => {
195
- relations.set({ room: roomKey, user: userKey })
196
- })
194
+ const userIsAlreadyInRoom = getFromStore(
195
+ store,
196
+ getInternalRelationsFromStore(store, usersInRooms),
197
+ roomKey,
198
+ ).has(userKey as any)
197
199
 
200
+ if (!userIsAlreadyInRoom) {
201
+ editRelationsInStore(store, usersInRooms, (relations) => {
202
+ relations.set({ room: roomKey, user: userKey })
203
+ })
204
+ }
198
205
  childSocket.emit(`user-joins`, userKey)
199
206
 
200
207
  toRoom = (payload) => {