Fix Workbench.mergeLoc when opening the same project (#4468)

Signed-off-by: Danil Uzlov <danil.uzlov@xored.com>
This commit is contained in:
Danil Uzlov 2024-01-30 15:05:55 +07:00 committed by GitHub
parent 6996945e48
commit 2ba02fa195
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -246,10 +246,12 @@
loc.path[3] = currentSpace ?? currentSpecial ?? resolved.defaultLocation.path[3]
if (loc.path[3] !== undefined && isSameApp) {
// setting space special/aside only if it belongs to the same app
if (loc.path[3] === resolved.defaultLocation.path[3]) {
if (currentSpace && currentSpecial) {
loc.path[4] = currentSpecial
} else if (loc.path[3] === resolved.defaultLocation.path[3]) {
loc.path[4] = resolved.defaultLocation.path[4]
} else {
loc.path[4] = (currentSpace && currentSpecial) ?? (asideId as string)
loc.path[4] = asideId as string
}
} else {
loc.path.length = 4