UBER-505: Fix resolve errors in console (#3449)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2023-06-22 15:22:37 +07:00
committed by GitHub
parent 747de753ae
commit ef3acfbf7c
5 changed files with 81 additions and 55 deletions
@@ -271,7 +271,11 @@
async function syncLoc (loc: Location): Promise<void> {
const originalLoc = JSON.stringify(loc)
// resolve short links
const resolvedLoc = await resolveShortLink(loc)
let resolvedLoc: ResolvedLocation | undefined
if (loc.path.length > 3 && getSpecialComponent(loc.path[3]) === undefined) {
resolvedLoc = await resolveShortLink(loc)
}
if (resolvedLoc && !areLocationsEqual(loc, resolvedLoc.loc)) {
loc = mergeLoc(loc, resolvedLoc)
}