From fb8bd1acfb0212c09ec7ae67e2d20a0013e74968 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Tue, 11 Oct 2022 17:22:58 -0600 Subject: [PATCH] Handle slugs with and without leading / --- web/pages/notifications.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/pages/notifications.tsx b/web/pages/notifications.tsx index 3ac7e714..cd5a7192 100644 --- a/web/pages/notifications.tsx +++ b/web/pages/notifications.tsx @@ -1220,10 +1220,9 @@ function getSourceUrl(notification: Notification) { sourceType )}` else if (sourceSlug) - return `${sourceSlug}#${getSourceIdForLinkComponent( - sourceId ?? '', - sourceType - )}` + return `${ + sourceSlug.startsWith('/') ? sourceSlug : '/' + sourceSlug + }#${getSourceIdForLinkComponent(sourceId ?? '', sourceType)}` } function getSourceIdForLinkComponent(