diff --git a/components/settings/HomeIndex.tsx b/components/settings/HomeIndex.tsx index 9c0919f5..43e6e3d6 100644 --- a/components/settings/HomeIndex.tsx +++ b/components/settings/HomeIndex.tsx @@ -188,13 +188,13 @@ export const HomeIndex = () => { const invalidateCache = useInvalidatePlaybackProgressCache(); - const refetch = useCallback(async () => { + const refetch = async () => { setLoading(true); await refreshStreamyfinPluginSettings(); await invalidateCache(); setLoading(false); - }, []); - + }; + const createCollectionConfig = useCallback( ( title: string, diff --git a/utils/atoms/settings.ts b/utils/atoms/settings.ts index 34b2f776..50046a7e 100644 --- a/utils/atoms/settings.ts +++ b/utils/atoms/settings.ts @@ -1,4 +1,4 @@ -import { atom, useAtom } from "jotai"; +import { atom, useAtom, useAtomValue } from "jotai"; import { useCallback, useEffect, useMemo } from "react"; import * as ScreenOrientation from "@/packages/expo-screen-orientation"; import { storage } from "../mmkv"; @@ -226,7 +226,7 @@ export const settingsAtom = atom | null>(null); export const pluginSettingsAtom = atom(storage.get(STREAMYFIN_PLUGIN_SETTINGS)); export const useSettings = () => { - const [api] = useAtom(apiAtom); + const api = useAtomValue(apiAtom); const [_settings, setSettings] = useAtom(settingsAtom); const [pluginSettings, _setPluginSettings] = useAtom(pluginSettingsAtom);