mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: use userId instead of socketId
This commit is contained in:
parent
62df03d78d
commit
2bdf09153c
5 changed files with 47 additions and 31 deletions
12
src/utils.ts
12
src/utils.ts
|
@ -20,6 +20,7 @@ import { unstable_batchedUpdates } from "react-dom";
|
|||
import { SHAPES } from "./shapes";
|
||||
import { isEraserActive, isHandToolActive } from "./appState";
|
||||
import { ResolutionType } from "./utility-types";
|
||||
import { reconcileElements } from "./excalidraw-app/collab/reconciliation";
|
||||
|
||||
let mockDateTime: string | null = null;
|
||||
|
||||
|
@ -907,3 +908,14 @@ export const isOnlyExportingSingleFrame = (
|
|||
)
|
||||
);
|
||||
};
|
||||
|
||||
export const upsertMap = <T>(key: T, value: object, map: Map<T, object>) => {
|
||||
if (!map.has(key)) {
|
||||
map.set(key, value);
|
||||
} else {
|
||||
const old = map.get(key);
|
||||
map.set(key, { ...old, ...value });
|
||||
}
|
||||
|
||||
return map;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue