mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
fix(typescript): resolve 44 TypeScript errors in core components (#1004)
This commit is contained in:
@@ -14,7 +14,7 @@ export type HapticFeedbackType =
|
||||
| "error";
|
||||
|
||||
export const useHaptic = (feedbackType: HapticFeedbackType = "selection") => {
|
||||
const [settings] = useSettings();
|
||||
const [settings] = useSettings(null);
|
||||
const isTv = Platform.isTV;
|
||||
const isDisabled =
|
||||
isTv ||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
export function useInterval(callback: () => void, delay: number | null) {
|
||||
const savedCallback = useRef<() => void>();
|
||||
const savedCallback = useRef<(() => void) | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
savedCallback.current = callback;
|
||||
|
||||
@@ -20,7 +20,7 @@ export const useJellyfinDiscovery = () => {
|
||||
setServers([]);
|
||||
|
||||
const discoveredServers = new Set<string>();
|
||||
let discoveryTimeout: number;
|
||||
let discoveryTimeout: ReturnType<typeof setTimeout>;
|
||||
|
||||
const socket = dgram.createSocket({
|
||||
type: "udp4",
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useQueryClient } from "@tanstack/react-query";
|
||||
import { t } from "i18next";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { toast } from "sonner-native";
|
||||
import type { Settings } from "@/utils/atoms/settings";
|
||||
import { defaultValues, Settings } from "@/utils/atoms/settings";
|
||||
import type { RTRating } from "@/utils/jellyseerr/server/api/rating/rottentomatoes";
|
||||
import {
|
||||
IssueStatus,
|
||||
@@ -417,8 +417,8 @@ export class JellyseerrApi {
|
||||
const jellyseerrUserAtom = atom(storage.get<JellyseerrUser>(JELLYSEERR_USER));
|
||||
|
||||
export const useJellyseerr = (
|
||||
settings: Settings,
|
||||
updateSettings: (update: Partial<Settings>) => void,
|
||||
settings: Settings = defaultValues,
|
||||
updateSettings: (update: Partial<Settings>) => void = () => {},
|
||||
) => {
|
||||
const [jellyseerrUser, setJellyseerrUser] = useAtom(jellyseerrUserAtom);
|
||||
const queryClient = useQueryClient();
|
||||
@@ -508,7 +508,9 @@ export const useJellyseerr = (
|
||||
item?: TvResult | TvDetails | MovieResult | MovieDetails,
|
||||
): MediaType => {
|
||||
return isJellyseerrResult(item)
|
||||
? item.mediaType
|
||||
? item.mediaType === "movie"
|
||||
? MediaType.MOVIE
|
||||
: MediaType.TV
|
||||
: item?.mediaInfo?.mediaType;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user