mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-24 23:02:44 +00:00
Fixed: Artists selection unselecting on mobile browsers
(cherry picked from commit 513b746fc3ff285f617389483401cb99c05c3359) Closes #3513
This commit is contained in:
parent
e00fbd6d7c
commit
0f5002338b
1 changed files with 4 additions and 2 deletions
|
@ -6,6 +6,7 @@ import AppState from 'App/State/AppState';
|
||||||
import { RENAME_ARTIST, RETAG_ARTIST } from 'Commands/commandNames';
|
import { RENAME_ARTIST, RETAG_ARTIST } from 'Commands/commandNames';
|
||||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
import SpinnerButton from 'Components/Link/SpinnerButton';
|
||||||
import PageContentFooter from 'Components/Page/PageContentFooter';
|
import PageContentFooter from 'Components/Page/PageContentFooter';
|
||||||
|
import usePrevious from 'Helpers/Hooks/usePrevious';
|
||||||
import { kinds } from 'Helpers/Props';
|
import { kinds } from 'Helpers/Props';
|
||||||
import {
|
import {
|
||||||
saveArtistEditor,
|
saveArtistEditor,
|
||||||
|
@ -58,6 +59,7 @@ function ArtistIndexSelectFooter() {
|
||||||
const [isSavingArtist, setIsSavingArtist] = useState(false);
|
const [isSavingArtist, setIsSavingArtist] = useState(false);
|
||||||
const [isSavingTags, setIsSavingTags] = useState(false);
|
const [isSavingTags, setIsSavingTags] = useState(false);
|
||||||
const [isSavingMonitoring, setIsSavingMonitoring] = useState(false);
|
const [isSavingMonitoring, setIsSavingMonitoring] = useState(false);
|
||||||
|
const previousIsDeleting = usePrevious(isDeleting);
|
||||||
|
|
||||||
const [selectState, selectDispatch] = useSelect();
|
const [selectState, selectDispatch] = useSelect();
|
||||||
const { selectedState } = selectState;
|
const { selectedState } = selectState;
|
||||||
|
@ -171,10 +173,10 @@ function ArtistIndexSelectFooter() {
|
||||||
}, [isSaving]);
|
}, [isSaving]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isDeleting && !deleteError) {
|
if (previousIsDeleting && !isDeleting && !deleteError) {
|
||||||
selectDispatch({ type: 'unselectAll' });
|
selectDispatch({ type: 'unselectAll' });
|
||||||
}
|
}
|
||||||
}, [isDeleting, deleteError, selectDispatch]);
|
}, [previousIsDeleting, isDeleting, deleteError, selectDispatch]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(fetchRootFolders());
|
dispatch(fetchRootFolders());
|
||||||
|
|
Loading…
Reference in a new issue