Revert "[RFC] Randomized names next to mouse pointers. (#971)" (#972)

This reverts commit dcb93f75e6.
This commit is contained in:
Christopher Chedeau 2020-03-16 00:38:37 -07:00 committed by GitHub
parent dcb93f75e6
commit db1f97f59e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 136 deletions

View file

@ -42,7 +42,6 @@ import {
SOCKET_SERVER,
SocketUpdateDataSource,
exportCanvas,
createNameFromSocketId,
} from "../data";
import { restore } from "../data/restore";
@ -361,15 +360,13 @@ export class App extends React.Component<any, AppState> {
}
break;
case "MOUSE_LOCATION":
const {
socketID,
pointerCoords,
username,
} = decryptedData.payload;
const { socketID, pointerCoords } = decryptedData.payload;
this.setState(state => {
const user = state.collaborators.get(socketID) || {};
if (!state.collaborators.has(socketID)) {
state.collaborators.set(socketID, {});
}
const user = state.collaborators.get(socketID)!;
user.pointer = pointerCoords;
user.username = username;
state.collaborators.set(socketID, user);
return state;
});
@ -414,7 +411,6 @@ export class App extends React.Component<any, AppState> {
payload: {
socketID: this.socket.id,
pointerCoords: payload.pointerCoords,
username: createNameFromSocketId(this.socket.id),
},
};
return this._broadcastSocketData(
@ -2286,7 +2282,6 @@ export class App extends React.Component<any, AppState> {
const pointerViewportCoords: {
[id: string]: { x: number; y: number };
} = {};
const pointerUsernames: { [id: string]: string } = {};
this.state.collaborators.forEach((user, socketID) => {
if (!user.pointer) {
return;
@ -2300,9 +2295,6 @@ export class App extends React.Component<any, AppState> {
this.canvas,
window.devicePixelRatio,
);
if (user.username) {
pointerUsernames[socketID] = user.username;
}
});
const { atLeastOneVisibleElement, scrollBars } = renderScene(
globalSceneState.getAllElements(),
@ -2317,7 +2309,6 @@ export class App extends React.Component<any, AppState> {
viewBackgroundColor: this.state.viewBackgroundColor,
zoom: this.state.zoom,
remotePointerViewportCoords: pointerViewportCoords,
remotePointerUsernames: pointerUsernames,
},
{
renderOptimizations: true,