Update all dependencies

This commit is contained in:
Lei Nelissen
2022-05-18 22:10:06 +02:00
parent 21eb1dca3b
commit f6835d0553
17 changed files with 2003 additions and 2296 deletions

View File

@@ -3,11 +3,10 @@ import React, { useCallback, useMemo } from 'react';
import { FlatListProps, View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import { SafeAreaView } from 'react-native-safe-area-context';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import formatBytes from 'utility/formatBytes';
import TrashIcon from 'assets/icons/trash.svg';
import ArrowClockwise from 'assets/icons/arrow-clockwise.svg';
import { useDispatch } from 'react-redux';
import { EntityId } from '@reduxjs/toolkit';
import { queueTrackForDownload, removeDownloadedTrack } from 'store/downloads/actions';
import Button from 'components/Button';
@@ -35,7 +34,7 @@ const AlbumImage = styled(FastImage)`
function Downloads() {
const defaultStyles = useDefaultStyles();
const dispatch = useDispatch();
const dispatch = useAppDispatch();
const getImage = useGetImage();
const { entities, ids } = useTypedSelector((state) => state.downloads);

View File

@@ -1,19 +1,18 @@
import React, { useCallback, useEffect } from 'react';
import { MusicStackParams } from '../types';
import { useRoute, RouteProp } from '@react-navigation/native';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import TrackListView from './components/TrackListView';
import { fetchTracksByAlbum } from 'store/music/actions';
import { differenceInDays } from 'date-fns';
import { ALBUM_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS';
import { t } from '@localisation';
import { useDispatch } from 'react-redux';
type Route = RouteProp<MusicStackParams, 'Album'>;
const Album: React.FC = () => {
const { params: { id } } = useRoute<Route>();
const dispatch = useDispatch();
const dispatch = useAppDispatch();
// Retrieve the album data from the store
const album = useTypedSelector((state) => state.music.albums.entities[id]);

View File

@@ -2,10 +2,9 @@ import React, { useCallback, useEffect, useRef, ReactText } from 'react';
import { useGetImage } from 'utility/JellyfinApi';
import { MusicNavigationProp } from '../types';
import { SafeAreaView, SectionList, View } from 'react-native';
import { useDispatch } from 'react-redux';
import { useNavigation } from '@react-navigation/native';
import { differenceInDays } from 'date-fns';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import { fetchAllAlbums } from 'store/music/actions';
import { ALBUM_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS';
import TouchableHandler from 'components/TouchableHandler';
@@ -103,7 +102,7 @@ const Albums: React.FC = () => {
const sections = useTypedSelector(selectAlbumsByAlphabet);
// Initialise helpers
const dispatch = useDispatch();
const dispatch = useAppDispatch();
const navigation = useNavigation<MusicNavigationProp>();
const getImage = useGetImage();
const listRef = useRef<SectionList<EntityId>>(null);

View File

@@ -1,19 +1,18 @@
import React, { useCallback, useEffect } from 'react';
import { MusicStackParams } from '../types';
import { useRoute, RouteProp } from '@react-navigation/native';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import TrackListView from './components/TrackListView';
import { fetchTracksByPlaylist } from 'store/music/actions';
import { differenceInDays } from 'date-fns';
import { ALBUM_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS';
import { t } from '@localisation';
import { useDispatch } from 'react-redux';
type Route = RouteProp<MusicStackParams, 'Album'>;
const Playlist: React.FC = () => {
const { params: { id } } = useRoute<Route>();
const dispatch = useDispatch();
const dispatch = useAppDispatch();
// Retrieve the album data from the store
const playlist = useTypedSelector((state) => state.music.playlists.entities[id]);

View File

@@ -2,10 +2,9 @@ import React, { useCallback, useEffect, useRef, ReactText } from 'react';
import { useGetImage } from 'utility/JellyfinApi';
import { MusicNavigationProp } from '../types';
import { Text, View, FlatList, ListRenderItem } from 'react-native';
import { useDispatch } from 'react-redux';
import { useNavigation } from '@react-navigation/native';
import { differenceInDays } from 'date-fns';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import { fetchAllPlaylists } from 'store/music/actions';
import { PLAYLIST_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS';
import TouchableHandler from 'components/TouchableHandler';
@@ -41,7 +40,7 @@ const Playlists: React.FC = () => {
const lastRefreshed = useTypedSelector((state) => state.music.playlists.lastRefreshed);
// Initialise helpers
const dispatch = useDispatch();
const dispatch = useAppDispatch();
const navigation = useNavigation<MusicNavigationProp>();
const getImage = useGetImage();
const listRef = useRef<FlatList<EntityId>>(null);

View File

@@ -2,9 +2,8 @@ import React, { useCallback, useEffect } from 'react';
import { useGetImage } from 'utility/JellyfinApi';
import { MusicNavigationProp } from '../types';
import { Text, SafeAreaView, FlatList, StyleSheet } from 'react-native';
import { useDispatch } from 'react-redux';
import { useNavigation } from '@react-navigation/native';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import { fetchRecentAlbums } from 'store/music/actions';
import TouchableHandler from 'components/TouchableHandler';
import ListContainer from './components/ListContainer';
@@ -59,7 +58,7 @@ const RecentAlbums: React.FC = () => {
const isLoading = useTypedSelector((state) => state.music.albums.isLoading);
// Initialise helpers
const dispatch = useDispatch();
const dispatch = useAppDispatch();
const navigation = useNavigation<MusicNavigationProp>();
const getImage = useGetImage();

View File

@@ -3,7 +3,7 @@ import { ScrollView, RefreshControl, StyleSheet, View } from 'react-native';
import { useGetImage } from 'utility/JellyfinApi';
import styled, { css } from 'styled-components/native';
import { useNavigation } from '@react-navigation/native';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import { THEME_COLOR } from 'CONSTANTS';
import TouchableHandler from 'components/TouchableHandler';
import useCurrentTrack from 'utility/useCurrentTrack';
@@ -18,7 +18,6 @@ import { MusicNavigationProp } from 'screens/Music/types';
import DownloadIcon from 'components/DownloadIcon';
import CloudDownArrow from 'assets/icons/cloud-down-arrow.svg';
import Trash from 'assets/icons/trash.svg';
import { useDispatch } from 'react-redux';
import { queueTrackForDownload, removeDownloadedTrack } from 'store/downloads/actions';
import { selectDownloadedTracks } from 'store/downloads/selectors';
import { Header, SubHeader } from 'components/Typography';
@@ -92,7 +91,7 @@ const TrackListView: React.FC<TrackListViewProps> = ({
const playTracks = usePlayTracks();
const { track: currentTrack } = useCurrentTrack();
const navigation = useNavigation<MusicNavigationProp>();
const dispatch = useDispatch();
const dispatch = useAppDispatch();
// Setup callbacks
const playEntity = useCallback(() => { playTracks(trackIds); }, [playTracks, trackIds]);

View File

@@ -2,8 +2,7 @@ import React, { useCallback, useEffect } from 'react';
import styled from 'styled-components/native';
import { useNavigation } from '@react-navigation/native';
import { NavigationProp } from 'screens';
import { useTypedSelector } from 'store';
import { useDispatch } from 'react-redux';
import { useAppDispatch, useTypedSelector } from 'store';
import { setOnboardingStatus } from 'store/settings/actions';
import { t } from '@localisation';
import Button from 'components/Button';
@@ -39,7 +38,7 @@ const Logo = styled.Image`
function Onboarding() {
// Get account from Redux and dispatcher
const account = useTypedSelector(state => state.settings.jellyfin);
const dispatch = useDispatch();
const dispatch = useAppDispatch();
// Also retrieve the navigation handler so that we can open the modal in
// which the Jellyfin server is set

View File

@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, useCallback } from 'react';
import Input from 'components/Input';
import { ActivityIndicator, Animated, SafeAreaView, View } from 'react-native';
import styled from 'styled-components/native';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import Fuse from 'fuse.js';
import { Album, AlbumTrack } from 'store/music/types';
import { FlatList } from 'react-native-gesture-handler';
@@ -14,7 +14,6 @@ import { t } from '@localisation';
import useDefaultStyles from 'components/Colors';
import { searchAndFetchAlbums } from 'store/music/actions';
import { debounce } from 'lodash';
import { useDispatch } from 'react-redux';
import { Text } from 'components/Typography';
import { MusicNavigationProp } from 'screens/Music/types';
import DownloadIcon from 'components/DownloadIcon';
@@ -117,7 +116,7 @@ export default function Search() {
const navigation = useNavigation<MusicNavigationProp>();
const keyboardHeight = useKeyboardHeight();
const getImage = useGetImage();
const dispatch = useDispatch();
const dispatch = useAppDispatch();
/**
* Since it is impractical to have a global fuse variable, we need to
@@ -139,7 +138,6 @@ export default function Search() {
// eslint-disable-next-line react-hooks/exhaustive-deps
const fetchJellyfinResults = useCallback(debounce(async (searchTerm: string, currentResults: CombinedResults) => {
// First, query the Jellyfin API
// @ts-expect-error need to fix this with AppDispatch
const { payload } = await dispatch(searchAndFetchAlbums({ term: searchTerm }));
// Convert the current results to album ids

View File

@@ -1,11 +1,11 @@
import React, { useCallback } from 'react';
import TrackPlayer from 'react-native-track-player';
import { useDispatch } from 'react-redux';
import music from 'store/music';
import { t } from '@localisation';
import Button from 'components/Button';
import styled from 'styled-components/native';
import { Text } from 'components/Typography';
import { useAppDispatch } from 'store';
const ClearCache = styled(Button)`
@@ -17,7 +17,7 @@ const Container = styled.ScrollView`
`;
export default function CacheSettings() {
const dispatch = useDispatch();
const dispatch = useAppDispatch();
const handleClearCache = useCallback(() => {
// Dispatch an action to reset the music subreducer state
dispatch(music.actions.reset());

View File

@@ -3,13 +3,13 @@ import { Button, View } from 'react-native';
import Modal from 'components/Modal';
import Input from 'components/Input';
import { setJellyfinCredentials } from 'store/settings/actions';
import { useDispatch } from 'react-redux';
import { useNavigation, StackActions } from '@react-navigation/native';
import CredentialGenerator from './components/CredentialGenerator';
import { THEME_COLOR } from 'CONSTANTS';
import { t } from '@localisation';
import useDefaultStyles from 'components/Colors';
import { Text } from 'components/Typography';
import { useAppDispatch } from 'store';
export default function SetJellyfinServer() {
@@ -19,7 +19,7 @@ export default function SetJellyfinServer() {
const [isLogginIn, setIsLogginIn] = useState<boolean>(false);
// Handlers needed for dispatching stuff
const dispatch = useDispatch();
const dispatch = useAppDispatch();
const navigation = useNavigation();
// Save creedentials to store and close the modal

View File

@@ -1,7 +1,7 @@
import React, { useCallback } from 'react';
import { useNavigation, StackActions, useRoute, RouteProp } from '@react-navigation/native';
import { ModalStackParams } from 'screens/types';
import { useTypedSelector } from 'store';
import { useAppDispatch, useTypedSelector } from 'store';
import { Header, SubHeader } from 'components/Typography';
import styled from 'styled-components/native';
import { t } from '@localisation';
@@ -12,7 +12,6 @@ import TrashIcon from 'assets/icons/trash.svg';
import { WrappableButton, WrappableButtonRow } from 'components/WrappableButtonRow';
import CoverImage from 'components/CoverImage';
import { useDispatch } from 'react-redux';
import { queueTrackForDownload, removeDownloadedTrack } from 'store/downloads/actions';
import usePlayTracks from 'utility/usePlayTracks';
import { selectIsDownloaded } from 'store/downloads/selectors';
@@ -37,7 +36,7 @@ function TrackPopupMenu() {
// Retrieve helpers
const navigation = useNavigation();
const dispatch = useDispatch();
const dispatch = useAppDispatch();
const playTracks = usePlayTracks();
const getImage = useGetImage();