From be1acfc2f96348ea79bf659babe19218a21fcb4b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 28 Mar 2022 17:50:11 -0700 Subject: [PATCH] Fixed: Re-assigning file that was mapped to multiple episodes to only one of those episodes Closes #4946 --- .../Interactive/InteractiveImportModalContentConnector.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContentConnector.js b/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContentConnector.js index 3599dd81a..f912fa9a3 100644 --- a/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContentConnector.js +++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContentConnector.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; +import hasDifferentItems from 'Utilities/Object/hasDifferentItems'; import { sortDirections } from 'Helpers/Props'; import { fetchInteractiveImportItems, setInteractiveImportSort, clearInteractiveImport, setInteractiveImportMode } from 'Store/Actions/interactiveImportActions'; import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector'; @@ -29,12 +30,7 @@ function isSameEpisodeFile(file, originalFile) { return false; } - const episodeIds = episodes.map((e) => e.id); - const originalEpisodeIds = originalFile.episodes ? originalFile.episodes.map((e) => e.id) : []; - - return episodeIds.every((episodeId) => { - return originalEpisodeIds.indexOf(episodeId) >= 0; - }); + return !hasDifferentItems(originalFile.episodes, episodes); } function createMapStateToProps() {