fix: mixing clientId & socketId in UserList (#7461)

This commit is contained in:
David Luzar 2023-12-18 18:21:57 +01:00 committed by GitHub
parent 0808532b49
commit 57ea4e61d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 39 deletions

View file

@ -41,7 +41,7 @@ import { Merge, ValueOf } from "./utility-types";
export type Point = Readonly<RoughPoint>;
export type SocketId = string;
export type SocketId = string & { _brand: "SocketId" };
export type Collaborator = Readonly<{
pointer?: CollaboratorPointer;
@ -128,7 +128,7 @@ export type SidebarName = string;
export type SidebarTabName = string;
export type UserToFollow = {
socketId: string;
socketId: SocketId;
username: string;
};
@ -296,7 +296,7 @@ export interface AppState {
offsetLeft: number;
fileHandle: FileSystemHandle | null;
collaborators: Map<string, Collaborator>;
collaborators: Map<SocketId, Collaborator>;
showStats: boolean;
currentChartType: ChartType;
pasteDialog:
@ -321,7 +321,7 @@ export interface AppState {
/** the user's clientId & username who is being followed on the canvas */
userToFollow: UserToFollow | null;
/** the clientIds of the users following the current user */
followedBy: Set<string>;
followedBy: Set<SocketId>;
}
export type UIAppState = Omit<
@ -474,7 +474,7 @@ export interface ExcalidrawProps {
export type SceneData = {
elements?: ImportedDataState["elements"];
appState?: ImportedDataState["appState"];
collaborators?: Map<string, Collaborator>;
collaborators?: Map<SocketId, Collaborator>;
commitToHistory?: boolean;
};