From 36a1b4d157ade69d4367e4feb819bc9f196f67d4 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Mon, 7 Feb 2022 16:05:54 +0700 Subject: [PATCH] Fix close panel on empty fragment (#938) Signed-off-by: Andrey Sobolev --- packages/ui/src/panelup.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/ui/src/panelup.ts b/packages/ui/src/panelup.ts index 1c6aac05d1..cdd9fa4ec2 100644 --- a/packages/ui/src/panelup.ts +++ b/packages/ui/src/panelup.ts @@ -17,6 +17,8 @@ location.subscribe((loc) => { if (loc.fragment !== currentLocation && loc.fragment !== undefined && loc.fragment.trim().length > 0) { const props = decodeURIComponent(loc.fragment).split('|') showPanel(props[0] as AnyComponent, props[1], props[2], 'full') + } else if (loc.fragment === '' || (loc.fragment !== undefined && loc.fragment.trim().length === 0)) { + closePanel() } })