mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 14:33:26 +00:00
chore: use enum
This commit is contained in:
@@ -4,6 +4,7 @@ import type { ItemData } from "~/components/item/item";
|
||||
import { ScraperProcess } from "~/components/player/ScraperProcess";
|
||||
import { VideoPlayer } from "~/components/player/VideoPlayer";
|
||||
import { usePlayer } from "~/hooks/player/usePlayer";
|
||||
import { PlayerStatus } from "~/stores/player/slices/interface";
|
||||
import { usePlayerStore } from "~/stores/player/store";
|
||||
|
||||
export default function VideoPlayerWrapper() {
|
||||
@@ -20,7 +21,8 @@ export default function VideoPlayerWrapper() {
|
||||
|
||||
void presentFullscreenPlayer();
|
||||
|
||||
if (playerStatus === "scraping") return <ScraperProcess data={data} />;
|
||||
if (playerStatus === PlayerStatus.SCRAPING)
|
||||
return <ScraperProcess data={data} />;
|
||||
|
||||
if (playerStatus === "ready") return <VideoPlayer />;
|
||||
if (playerStatus === PlayerStatus.READY) return <VideoPlayer />;
|
||||
}
|
||||
|
@@ -4,7 +4,10 @@ import type { SeasonDetails } from "@movie-web/tmdb";
|
||||
import type { MakeSlice } from "./types";
|
||||
import type { ItemData } from "~/components/item/item";
|
||||
|
||||
export type PlayerStatus = "scraping" | "ready";
|
||||
export enum PlayerStatus {
|
||||
SCRAPING = "scraping",
|
||||
READY = "ready",
|
||||
}
|
||||
|
||||
export interface InterfaceSlice {
|
||||
interface: {
|
||||
@@ -41,7 +44,7 @@ export const createInterfaceSlice: MakeSlice<InterfaceSlice> = (set, get) => ({
|
||||
seasonData: null,
|
||||
selectedCaption: null,
|
||||
hlsTracks: null,
|
||||
playerStatus: "scraping",
|
||||
playerStatus: PlayerStatus.SCRAPING,
|
||||
},
|
||||
setIsIdle: (state) => {
|
||||
set((s) => {
|
||||
@@ -105,7 +108,7 @@ export const createInterfaceSlice: MakeSlice<InterfaceSlice> = (set, get) => ({
|
||||
seasonData: null,
|
||||
selectedCaption: null,
|
||||
hlsTracks: null,
|
||||
playerStatus: "scraping",
|
||||
playerStatus: PlayerStatus.SCRAPING,
|
||||
},
|
||||
}));
|
||||
},
|
||||
|
Reference in New Issue
Block a user