diff --git a/web/src/interfaces/AdminInterface.ts b/web/src/interfaces/AdminInterface.ts index b8aa7a1a0..bfffc130f 100644 --- a/web/src/interfaces/AdminInterface.ts +++ b/web/src/interfaces/AdminInterface.ts @@ -25,6 +25,7 @@ import "../elements/messages/MessageContainer"; import "../elements/messages/MessageContainer"; import "../elements/notifications/NotificationDrawer"; import { ID_REGEX, SLUG_REGEX, UUID_REGEX } from "../elements/router/Route"; +import { getURLParam, updateURLParams } from "../elements/router/RouteMatch"; import "../elements/router/RouterOutlet"; import "../elements/sidebar/Sidebar"; import "../elements/sidebar/SidebarItem"; @@ -37,10 +38,10 @@ export class AdminInterface extends LitElement { sidebarOpen = true; @property({ type: Boolean }) - notificationOpen = false; + notificationDrawerOpen = getURLParam("notificationDrawerOpen", false); @property({ type: Boolean }) - apiDrawerOpen = false; + apiDrawerOpen = getURLParam("apiDrawerOpen", false); ws: WebsocketClient; @@ -87,10 +88,16 @@ export class AdminInterface extends LitElement { this.sidebarOpen = !this.sidebarOpen; }); window.addEventListener(EVENT_NOTIFICATION_DRAWER_TOGGLE, () => { - this.notificationOpen = !this.notificationOpen; + this.notificationDrawerOpen = !this.notificationDrawerOpen; + updateURLParams({ + notificationDrawerOpen: this.notificationDrawerOpen, + }); }); window.addEventListener(EVENT_API_DRAWER_TOGGLE, () => { this.apiDrawerOpen = !this.apiDrawerOpen; + updateURLParams({ + apiDrawerOpen: this.apiDrawerOpen, + }); }); this.version = new AdminApi(DEFAULT_CONFIG).adminVersionRetrieve(); } @@ -104,7 +111,7 @@ export class AdminInterface extends LitElement {