From 2a2ae4bc4f2d79696841bb69b8a76c60a4faf9a4 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 2 Jul 2022 22:53:16 +0200 Subject: [PATCH] web/admin: default to users path in sidebar link Signed-off-by: Jens Langhammer --- web/src/elements/sidebar/SidebarItem.ts | 3 ++- web/src/interfaces/AdminInterface.ts | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web/src/elements/sidebar/SidebarItem.ts b/web/src/elements/sidebar/SidebarItem.ts index bc98697eb..187537617 100644 --- a/web/src/elements/sidebar/SidebarItem.ts +++ b/web/src/elements/sidebar/SidebarItem.ts @@ -123,7 +123,8 @@ export class SidebarItem extends LitElement { return false; } if (this.path) { - if (new RegExp(`^${this.path}$`).exec(path)) { + const ourPath = this.path.split(";")[0]; + if (new RegExp(`^${ourPath}$`).exec(path)) { return true; } } diff --git a/web/src/interfaces/AdminInterface.ts b/web/src/interfaces/AdminInterface.ts index 4426e9556..99a47cfb6 100644 --- a/web/src/interfaces/AdminInterface.ts +++ b/web/src/interfaces/AdminInterface.ts @@ -267,7 +267,11 @@ export class AdminInterface extends LitElement { ${t`Directory`} ${ID_REGEX})$`]} > ${t`Users`}