Handle slugs with and without leading /

This commit is contained in:
Ian Philips 2022-10-11 17:22:58 -06:00
parent 4215821f35
commit fb8bd1acfb

View File

@ -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(