Fixed: Remove pre-DB from frontend storage

pull/7073/head
Robin Dadswell 3 years ago committed by Qstick
parent b1afd7aaaa
commit 7de270b212

@ -1,5 +1,7 @@
import migrateBlacklistToBlocklist from './migrateBlacklistToBlocklist';
import migratePreDbToReleased from './migratePreDbToReleased';
export default function migrate(persistedState) {
migrateBlacklistToBlocklist(persistedState);
migratePreDbToReleased(persistedState);
}

@ -0,0 +1,18 @@
import get from 'lodash';
export default function migratePreDbToReleased(persistedState) {
const addMovie = get(persistedState, 'addMovie.defaults.minimumAvailability');
const discoverMovie = get(persistedState, 'discoverMovie.defaults.minimumAvailability');
if (!addMovie && !discoverMovie) {
return;
}
if (addMovie === 'preDB') {
persistedState.addMovie.defaults.minimumAvailability = 'released';
}
if (discoverMovie === 'preDB') {
persistedState.discoverMovie.defaults.minimumAvailability = 'released';
}
}
Loading…
Cancel
Save