fix(library): optimize image scanning, fast raw preview extraction and lazy thumbnail loading
This commit is contained in:
@@ -37,18 +37,13 @@ function pick(route: string) {
|
||||
);
|
||||
}
|
||||
|
||||
// Links are plain `<a href>`, so following one throws the page away — fine
|
||||
// everywhere except while a roll is being read: that scan runs for minutes in
|
||||
// this page's memory, and only the studio needs to be reachable from the
|
||||
// catalogue. So the click is taken over *only* while a scan is in flight, and
|
||||
// the browser keeps doing the navigating the rest of the time.
|
||||
// Intercept internal link clicks for instant SPA transitions without full page reload
|
||||
function Shell() {
|
||||
const [route, setRoute] = useState(() => window.location.pathname + window.location.search);
|
||||
|
||||
useEffect(() => {
|
||||
const onClick = (e: MouseEvent) => {
|
||||
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
||||
if (!scanSession()) return;
|
||||
const target = e.target as Element | null;
|
||||
const link = target?.closest?.('a');
|
||||
if (!(link instanceof HTMLAnchorElement)) return;
|
||||
|
||||
Reference in New Issue
Block a user