sections are paths, not a query string
The admin declares its routes in the manifest, so /fofos-admin/layout/header and /fofos-admin/pages/home are real URLs. One reader takes the two segments after the mount; links carry no query string at all, so nothing leaks between sections. What stays in the query is how you are looking — device, tab, view — rather than at what. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+5
-3
@@ -1,4 +1,5 @@
|
||||
import { Images } from 'lucide-react';
|
||||
import { href } from './routes';
|
||||
import type { FileAction } from 'officerdev';
|
||||
|
||||
/**
|
||||
@@ -81,11 +82,12 @@ export const fileActions: FileAction[] = [
|
||||
and watching the items land belongs on the screen that owns galleries, not in a modal over a
|
||||
file browser that would then have to explain where the result went.
|
||||
*/
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
params.set('section', 'galleries');
|
||||
// The section is a PATH now, so this names it rather than editing the current query. `create` and
|
||||
// `from` stay in the query: they are a one-shot handover, not where you are.
|
||||
const params = new URLSearchParams();
|
||||
params.set('create', entries.length === 1 && entries[0]!.type === 'directory' ? entries[0]!.name : '');
|
||||
params.set('from', paths.join('\n'));
|
||||
window.history.pushState({}, '', `${window.location.pathname}?${params.toString()}`);
|
||||
window.history.pushState({}, '', `${href('galleries')}?${params.toString()}`);
|
||||
// The router listens for this; pushState alone does not notify it.
|
||||
window.dispatchEvent(new PopStateEvent('popstate'));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user