1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2024-11-10 11:35:52 +01:00

fix: Don't scroll to content on INIT websocket message (#3291)

If you load a shared scene with at least another person on the scene, you can start seeing the content via the firebase response. If you scroll and you receive the response from the websocket INIT, then it scrolls you back to the center which is jarring.

This PR removes the scroll to content for that use case.
This commit is contained in:
Christopher Chedeau 2021-03-21 09:25:19 -07:00 committed by GitHub
parent 86bf2d697d
commit 127c1be6ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -448,15 +448,8 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
private handleRemoteSceneUpdate = (
elements: ReconciledElements,
{
init = false,
initFromSnapshot = false,
}: { init?: boolean; initFromSnapshot?: boolean } = {},
{ init = false }: { init?: boolean } = {},
) => {
if (init || initFromSnapshot) {
this.excalidrawAPI.setScrollToContent(elements);
}
this.excalidrawAPI.updateScene({
elements,
commitToHistory: !!init,