From 13a0c0c505edd4b00f9d7b5aed78237c4d23a3d1 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 22 Sep 2022 09:59:00 -0400 Subject: remove overlaydocs when switching dashboards. --- src/fields/Doc.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/fields') diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 74a3d8cf2..a3c742f28 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -239,6 +239,8 @@ export class Doc extends RefField { return DocCast(Doc.UserDoc().activeDashboard); } public static set ActiveDashboard(val: Doc | undefined) { + const overlays = Cast(Doc.MyOverlayDocs.data, listSpec(Doc), null); + overlays && (overlays.length = 0); Doc.UserDoc().activeDashboard = val; } public static set ActiveTool(tool: InkTool) { -- cgit v1.2.3-70-g09d2