fix(webui): preserve import tab refresh URLs
- stop the legacy shell bootstrap from collapsing /import/auto and /import/singles back to the import root on reload\n- update the shell route smoke test to expect the canonical /import/album redirect for the bare import page
This commit is contained in:
parent
ae0711f464
commit
b78350a3e2
2 changed files with 5 additions and 3 deletions
|
|
@ -1190,9 +1190,7 @@ async function loadInitialData() {
|
||||||
if (route?.kind === 'react') {
|
if (route?.kind === 'react') {
|
||||||
showReactHost(targetPage);
|
showReactHost(targetPage);
|
||||||
setActivePageChrome(targetPage);
|
setActivePageChrome(targetPage);
|
||||||
if (window.location.pathname !== route.path) {
|
// Keep nested react-tab URLs like /import/auto or /import/singles intact.
|
||||||
history.replaceState({ page: targetPage }, '', route.path);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,10 @@ function expectedUrlPattern(path: string, pageId: ShellPageId): RegExp {
|
||||||
return /\/stats(?:\?range=7d)?$/;
|
return /\/stats(?:\?range=7d)?$/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pageId === 'import') {
|
||||||
|
return /\/import\/album$/;
|
||||||
|
}
|
||||||
|
|
||||||
return new RegExp(`${path.replace('/', '\\/')}$`);
|
return new RegExp(`${path.replace('/', '\\/')}$`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue