fix collab MOUSE_LOCATION payload naming for legacy versions (#2098)

This commit is contained in:
David Luzar 2020-08-29 14:12:58 +02:00 committed by GitHub
parent 1828a93ba7
commit 0e28177ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1298,12 +1298,17 @@ class App extends React.Component<ExcalidrawProps, AppState> {
break;
case "MOUSE_LOCATION": {
const {
socketId,
pointer,
button,
username,
selectedElementIds,
} = decryptedData.payload;
const socketId: SocketUpdateDataSource["MOUSE_LOCATION"]["payload"]["socketId"] =
decryptedData.payload.socketId ||
// @ts-ignore legacy, see #2094 (#2097)
decryptedData.payload.socketID;
// NOTE purposefully mutating collaborators map in case of
// pointer updates so as not to trigger LayerUI rerender
this.setState((state) => {