From 91e3fcc7ff3acfbceb05130aa664f4741600547c Mon Sep 17 00:00:00 2001 From: DingDongSoLong4 <99329275+DingDongSoLong4@users.noreply.github.com> Date: Wed, 13 Jul 2022 02:08:02 +0200 Subject: [PATCH] Fix lodash-es typos (#2724) * Fix LocalForage not saving items * Fix bulk update typos --- ui/v2.5/src/components/Scenes/EditScenesDialog.tsx | 6 +++--- ui/v2.5/src/hooks/LocalForage.ts | 2 +- ui/v2.5/src/utils/bulkUpdate.ts | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/v2.5/src/components/Scenes/EditScenesDialog.tsx b/ui/v2.5/src/components/Scenes/EditScenesDialog.tsx index 7c4875c61..7880cece9 100644 --- a/ui/v2.5/src/components/Scenes/EditScenesDialog.tsx +++ b/ui/v2.5/src/components/Scenes/EditScenesDialog.tsx @@ -144,13 +144,13 @@ export const EditScenesDialog: React.FC = ( if (sceneStudioID !== updateStudioID) { updateStudioID = undefined; } - if (isEqual(scenePerformerIDs, updatePerformerIds)) { + if (!isEqual(scenePerformerIDs, updatePerformerIds)) { updatePerformerIds = []; } - if (isEqual(sceneTagIDs, updateTagIds)) { + if (!isEqual(sceneTagIDs, updateTagIds)) { updateTagIds = []; } - if (isEqual(sceneMovieIDs, updateMovieIds)) { + if (!isEqual(sceneMovieIDs, updateMovieIds)) { updateMovieIds = []; } if (scene.organized !== updateOrganized) { diff --git a/ui/v2.5/src/hooks/LocalForage.ts b/ui/v2.5/src/hooks/LocalForage.ts index b8e6aae9a..3632198f9 100644 --- a/ui/v2.5/src/hooks/LocalForage.ts +++ b/ui/v2.5/src/hooks/LocalForage.ts @@ -69,7 +69,7 @@ export function useLocalForage( }, [loading, key, defaultValue]); useEffect(() => { - if (isEqual(Cache[key], data)) { + if (!isEqual(Cache[key], data)) { Cache[key] = { ...Cache[key], ...data, diff --git a/ui/v2.5/src/utils/bulkUpdate.ts b/ui/v2.5/src/utils/bulkUpdate.ts index 542a57337..9ffba6796 100644 --- a/ui/v2.5/src/utils/bulkUpdate.ts +++ b/ui/v2.5/src/utils/bulkUpdate.ts @@ -63,7 +63,7 @@ export function getAggregatePerformerIds(state: IHasPerformers[]) { } else { const perfIds = o.performers ? o.performers.map((p) => p.id).sort() : []; - if (isEqual(ret, perfIds)) { + if (!isEqual(ret, perfIds)) { ret = []; } } @@ -87,7 +87,7 @@ export function getAggregateTagIds(state: IHasTags[]) { } else { const tIds = o.tags ? o.tags.map((t) => t.id).sort() : []; - if (isEqual(ret, tIds)) { + if (!isEqual(ret, tIds)) { ret = []; } } @@ -115,7 +115,7 @@ export function getAggregateMovieIds(state: IHasMovies[]) { } else { const mIds = o.movies ? o.movies.map((m) => m.movie.id).sort() : []; - if (isEqual(ret, mIds)) { + if (!isEqual(ret, mIds)) { ret = []; } } @@ -180,7 +180,7 @@ export function getAggregateState( newValue: T, first: boolean ) { - if (!first && isEqual(currentValue, newValue)) { + if (!first && !isEqual(currentValue, newValue)) { return undefined; }