From 2f8d973b075cc754c7d39bdeceba964675abf61f Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Thu, 18 Nov 2021 16:38:49 +0000 Subject: [PATCH] Fix error when starting a session while already in a session. --- packages/tldraw/src/state/TldrawApp.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/tldraw/src/state/TldrawApp.ts b/packages/tldraw/src/state/TldrawApp.ts index 5cea553e0..126b0407f 100644 --- a/packages/tldraw/src/state/TldrawApp.ts +++ b/packages/tldraw/src/state/TldrawApp.ts @@ -1879,7 +1879,8 @@ export class TldrawApp extends StateManager { startSession = (type: T, ...args: SessionArgsOfType): this => { if (this.readOnly && type !== SessionType.Brush) return this if (this.session) { - throw Error(`Already in a session! (${this.session.constructor.name})`) + console.warn(`Already in a session! (${this.session.constructor.name})`) + this.cancelSession() } const Session = getSession(type)