UBERF-7073 Properly resolve folder id from fragment (#5677)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2024-05-27 23:38:13 +07:00 committed by GitHub
parent 99c5387f19
commit 434f9bf48c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,8 +27,8 @@ export function getPanelFragment<T extends Doc> (object: Pick<T, '_class' | '_id
}
export function getFolderIdFromFragment (fragment: string): Ref<Folder> | undefined {
const [, _id] = decodeURIComponent(fragment).split('|')
return _id as Ref<Folder>
const [, _id, _class] = decodeURIComponent(fragment).split('|')
return _class === drive.class.Folder ? (_id as Ref<Folder>) : drive.ids.Root
}
export function getDriveLink (_id: Ref<Drive>): Location {