UBERF-5914 Highlight current wiki document in navigator (#4899)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2024-03-07 22:41:51 +07:00 committed by GitHub
parent 9ef5b8f172
commit 0abd2e39d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,6 @@
} }
let selected: Ref<Document> | undefined let selected: Ref<Document> | undefined
// TODO find a better way than parsing current fragment
$: selected = getDocumentIdFromFragment(currentFragment ?? '') $: selected = getDocumentIdFromFragment(currentFragment ?? '')
// TODO expand tree until the selected document ? // TODO expand tree until the selected document ?

View File

@ -101,8 +101,9 @@ export async function generateLocation (loc: Location, id: Ref<Document>): Promi
} }
} }
export function getDocumentIdFromFragment (fragment: string): Ref<Document> { export function getDocumentIdFromFragment (fragment: string): Ref<Document> | undefined {
return fragment as Ref<Document> const [, _id] = decodeURIComponent(fragment).split('|')
return _id as Ref<Document>
} }
export function getDocumentUrl (doc: Document): string { export function getDocumentUrl (doc: Document): string {