mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-14 10:05:05 +01:00
pwa fix and dont remove t param after use
This commit is contained in:
parent
92bca33b91
commit
df5735cfbf
@ -109,7 +109,9 @@ function EpisodesView({
|
|||||||
const newData = setPlayerMeta(loadingState.value.fullData, episodeId);
|
const newData = setPlayerMeta(loadingState.value.fullData, episodeId);
|
||||||
if (newData) onChange?.(newData);
|
if (newData) onChange?.(newData);
|
||||||
}
|
}
|
||||||
router.close();
|
// prevent router clear here, otherwise its done double
|
||||||
|
// player already switches route after meta change
|
||||||
|
router.close(true);
|
||||||
},
|
},
|
||||||
[setPlayerMeta, loadingState, router, onChange]
|
[setPlayerMeta, loadingState, router, onChange]
|
||||||
);
|
);
|
||||||
|
@ -91,10 +91,13 @@ export function useInternalOverlayRouter(id: string) {
|
|||||||
return routerActive;
|
return routerActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
const close = useCallback(() => {
|
const close = useCallback(
|
||||||
if (route) setRoute(null);
|
(preventRouteClear?: boolean) => {
|
||||||
|
if (route && !preventRouteClear) setRoute(null);
|
||||||
setTransition(null);
|
setTransition(null);
|
||||||
}, [setRoute, route, setTransition]);
|
},
|
||||||
|
[setRoute, route, setTransition]
|
||||||
|
);
|
||||||
|
|
||||||
const open = useCallback(
|
const open = useCallback(
|
||||||
(defaultRoute = "/") => {
|
(defaultRoute = "/") => {
|
||||||
|
@ -32,7 +32,7 @@ export function useQueryParam(
|
|||||||
search: parsed.toString(),
|
search: parsed.toString(),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[param, location, router]
|
[param, location.search, router]
|
||||||
);
|
);
|
||||||
|
|
||||||
return [currentValue, set];
|
return [currentValue, set];
|
||||||
|
@ -26,7 +26,7 @@ export function PlayerView() {
|
|||||||
sources: Record<string, ScrapingSegment>;
|
sources: Record<string, ScrapingSegment>;
|
||||||
sourceOrder: ScrapingItems[];
|
sourceOrder: ScrapingItems[];
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
const [startAtParam, setStartAtParam] = useQueryParam("t");
|
const [startAtParam] = useQueryParam("t");
|
||||||
const { status, playMedia, reset, setScrapeNotFound } = usePlayer();
|
const { status, playMedia, reset, setScrapeNotFound } = usePlayer();
|
||||||
const { setPlayerMeta, scrapeMedia } = usePlayerMeta();
|
const { setPlayerMeta, scrapeMedia } = usePlayerMeta();
|
||||||
const backUrl = useLastNonPlayerLink();
|
const backUrl = useLastNonPlayerLink();
|
||||||
@ -54,14 +54,13 @@ export function PlayerView() {
|
|||||||
const playAfterScrape = useCallback(
|
const playAfterScrape = useCallback(
|
||||||
(out: RunOutput | null) => {
|
(out: RunOutput | null) => {
|
||||||
if (!out) return;
|
if (!out) return;
|
||||||
|
|
||||||
let startAt: number | undefined;
|
let startAt: number | undefined;
|
||||||
if (startAtParam) {
|
if (startAtParam) startAt = parseTimestamp(startAtParam) ?? undefined;
|
||||||
setStartAtParam(null);
|
|
||||||
startAt = parseTimestamp(startAtParam) ?? undefined;
|
|
||||||
}
|
|
||||||
playMedia(convertRunoutputToSource(out), out.sourceId, startAt);
|
playMedia(convertRunoutputToSource(out), out.sourceId, startAt);
|
||||||
},
|
},
|
||||||
[playMedia, setStartAtParam, startAtParam]
|
[playMedia, startAtParam]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -54,6 +54,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
theme_color: "#120f1d",
|
theme_color: "#120f1d",
|
||||||
background_color: "#120f1d",
|
background_color: "#120f1d",
|
||||||
display: "standalone",
|
display: "standalone",
|
||||||
|
orientation: "portrait-primary",
|
||||||
start_url: "/",
|
start_url: "/",
|
||||||
icons: [
|
icons: [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user