Skip to content

Commit baea30a

Browse files
christianalfoniCompuIves
authored andcommitted
Fix selection issue (codesandbox#2404)
1 parent a96e0a1 commit baea30a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/app/src/app/overmind/namespaces/live/internalActions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from '@codesandbox/common/lib/types';
77
import { json } from 'overmind';
88

9-
export const clearUserSelections: Action<any> = ({ state }, data) => {
9+
export const clearUserSelections: Action<any> = ({ state }, live_user_id) => {
1010
const clearSelections = userId => {
1111
const userIndex = state.live.roomInfo.users.findIndex(u => u.id === userId);
1212

@@ -23,11 +23,11 @@ export const clearUserSelections: Action<any> = ({ state }, data) => {
2323
}
2424
};
2525

26-
if (!data) {
26+
if (!live_user_id) {
2727
// All users
2828
state.live.roomInfo.users.forEach(u => clearSelections(u.id));
2929
} else {
30-
clearSelections(data.live_user_id);
30+
clearSelections(live_user_id);
3131
}
3232
};
3333

packages/app/src/app/overmind/namespaces/live/liveMessageOperators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export const onUserCurrentModule: Operator<
280280
data.moduleShortid;
281281
}
282282

283-
actions.live.internal.clearUserSelections(data);
283+
actions.live.internal.clearUserSelections(null);
284284

285285
if (
286286
state.live.followingUserId === data.live_user_id &&
@@ -308,7 +308,7 @@ export const onLiveMode: Operator<
308308
if (!_isOwnMessage) {
309309
state.live.roomInfo.mode = data.mode;
310310
}
311-
actions.live.internal.clearUserSelections(data);
311+
actions.live.internal.clearUserSelections(null);
312312
state.editor.pendingUserSelections = state.editor.pendingUserSelections.concat(
313313
actions.live.internal.getSelectionsForModule(state.editor.currentModule)
314314
);

0 commit comments

Comments
 (0)