// Internal navigation, in one place. SPA in-place navigation preserves // in-memory photo and folder caches when transitioning between Web Studio // (/app) and Library (/library). // // `replace` is for the moves that are not steps: a screen sending a visitor back // where they belong (the library, to a guest) must not leave itself as the page // the Back button returns to, or the visitor is pushed off it on every press. export function go(url: string, replace = false): void { if (replace) history.replaceState(null, '', url); else history.pushState(null, '', url); window.dispatchEvent(new PopStateEvent('popstate')); }