1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Compare commits

...

4 commits

Author SHA1 Message Date
Ivan Evans
95b32bee01
Merge 01ef6dd473 into 7495d51408 2024-09-24 09:04:28 +01:00
Cooper
7495d51408
Fix an error in fetch.ts (probably the source of these build issues) 2024-09-23 11:42:49 +00:00
Ivan Evans
01ef6dd473
Merge branch 'sussy-code:main' into scraping-interrupt-buttons 2024-09-16 22:59:14 -06:00
Ivan Evans
808fe15709 Make scraping buttons stay on top 2024-09-11 23:49:28 -06:00
3 changed files with 37 additions and 20 deletions

View file

@ -69,7 +69,12 @@ export async function singularProxiedFetch<T>(
onResponse(context) {
const tokenHeader = context.response.headers.get("X-Token");
if (tokenHeader) setApiToken(tokenHeader);
ops.onResponse?.(context);
if (Array.isArray(ops.onResponse)) {
ops.onResponse.forEach((hook) => hook(context));
} else {
ops.onResponse?.(context);
}
},
});
}

View file

@ -7,6 +7,8 @@ import { useIsMobile } from "@/hooks/useIsMobile";
import { PlayerMeta, playerStatus } from "@/stores/player/slices/source";
import { usePlayerStore } from "@/stores/player/store";
import { ScrapingPartInterruptButton } from "./ScrapingPart";
export interface PlayerPartProps {
children?: ReactNode;
backUrl: string;
@ -80,7 +82,10 @@ export function PlayerPart(props: PlayerPartProps) {
</Player.TopControls>
<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 ? (
<>
{isMobile ? <Player.Time short /> : null}

View file

@ -151,25 +151,32 @@ export function ScrapingPart(props: ScrapingProps) {
</div>
);
})}
<div className="flex gap-3 pb-3">
<Button
href="/"
theme="secondary"
padding="md:px-17 p-3"
className="mt-6"
>
{t("notFound.goHome")}
</Button>
<Button
onClick={() => window.location.reload()}
theme="purple"
padding="md:px-17 p-3"
className="mt-6"
>
{t("notFound.reloadButton")}
</Button>
</div>
</div>
</div>
);
}
export function ScrapingPartInterruptButton() {
const { t } = useTranslation();
return (
<div className="flex gap-3 pb-3">
<Button
href="/"
theme="secondary"
padding="md:px-17 p-3"
className="mt-6"
>
{t("notFound.goHome")}
</Button>
<Button
onClick={() => window.location.reload()}
theme="purple"
padding="md:px-17 p-3"
className="mt-6"
>
{t("notFound.reloadButton")}
</Button>
</div>
);
}