fix: type errors

This commit is contained in:
Lei Nelissen
2024-01-29 00:14:19 +01:00
parent 2d9b81651c
commit 6411bfbbb6
5 changed files with 766 additions and 210 deletions

View File

@@ -9,7 +9,7 @@ import { THEME_COLOR } from '@/CONSTANTS';
import { t } from '@/localisation';
import useDefaultStyles from '@/components/Colors';
import { Text } from '@/components/Typography';
import { useAppDispatch } from '@/store';
import { AppState, useAppDispatch } from '@/store';
export default function SetJellyfinServer() {
@@ -23,9 +23,11 @@ export default function SetJellyfinServer() {
const navigation = useNavigation();
// Save creedentials to store and close the modal
const saveCredentials = useCallback((credentials) => {
dispatch(setJellyfinCredentials(credentials));
navigation.dispatch(StackActions.popToTop());
const saveCredentials = useCallback((credentials: AppState['settings']['jellyfin']) => {
if (credentials) {
dispatch(setJellyfinCredentials(credentials));
navigation.dispatch(StackActions.popToTop());
}
}, [navigation, dispatch]);
return (