mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Compare commits
4 commits
5cd9d04742
...
95b32bee01
Author | SHA1 | Date | |
---|---|---|---|
|
95b32bee01 | ||
|
7495d51408 | ||
|
01ef6dd473 | ||
|
808fe15709 |
3 changed files with 37 additions and 20 deletions
|
@ -69,7 +69,12 @@ export async function singularProxiedFetch<T>(
|
||||||
onResponse(context) {
|
onResponse(context) {
|
||||||
const tokenHeader = context.response.headers.get("X-Token");
|
const tokenHeader = context.response.headers.get("X-Token");
|
||||||
if (tokenHeader) setApiToken(tokenHeader);
|
if (tokenHeader) setApiToken(tokenHeader);
|
||||||
|
|
||||||
|
if (Array.isArray(ops.onResponse)) {
|
||||||
|
ops.onResponse.forEach((hook) => hook(context));
|
||||||
|
} else {
|
||||||
ops.onResponse?.(context);
|
ops.onResponse?.(context);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import { useIsMobile } from "@/hooks/useIsMobile";
|
||||||
import { PlayerMeta, playerStatus } from "@/stores/player/slices/source";
|
import { PlayerMeta, playerStatus } from "@/stores/player/slices/source";
|
||||||
import { usePlayerStore } from "@/stores/player/store";
|
import { usePlayerStore } from "@/stores/player/store";
|
||||||
|
|
||||||
|
import { ScrapingPartInterruptButton } from "./ScrapingPart";
|
||||||
|
|
||||||
export interface PlayerPartProps {
|
export interface PlayerPartProps {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
backUrl: string;
|
backUrl: string;
|
||||||
|
@ -80,7 +82,10 @@ export function PlayerPart(props: PlayerPartProps) {
|
||||||
</Player.TopControls>
|
</Player.TopControls>
|
||||||
|
|
||||||
<Player.BottomControls show={showTargets}>
|
<Player.BottomControls show={showTargets}>
|
||||||
<div className="flex items-center space-x-3">
|
<div className="flex items-center justify-center space-x-3 h-full">
|
||||||
|
{status === playerStatus.SCRAPING ? (
|
||||||
|
<ScrapingPartInterruptButton />
|
||||||
|
) : null}
|
||||||
{status === playerStatus.PLAYING ? (
|
{status === playerStatus.PLAYING ? (
|
||||||
<>
|
<>
|
||||||
{isMobile ? <Player.Time short /> : null}
|
{isMobile ? <Player.Time short /> : null}
|
||||||
|
|
|
@ -151,6 +151,15 @@ export function ScrapingPart(props: ScrapingProps) {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ScrapingPartInterruptButton() {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
return (
|
||||||
<div className="flex gap-3 pb-3">
|
<div className="flex gap-3 pb-3">
|
||||||
<Button
|
<Button
|
||||||
href="/"
|
href="/"
|
||||||
|
@ -169,7 +178,5 @@ export function ScrapingPart(props: ScrapingProps) {
|
||||||
{t("notFound.reloadButton")}
|
{t("notFound.reloadButton")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue