You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
674 B
27 lines
674 B
import get from 'lodash';
|
|
|
|
export default function migrateMonitorToEnum(persistedState) {
|
|
const addMovie = get(persistedState, 'addMovie.defaults.monitor');
|
|
const discoverMovie = get(persistedState, 'discoverMovie.defaults.monitor');
|
|
|
|
if (!addMovie && !discoverMovie) {
|
|
return;
|
|
}
|
|
|
|
if (addMovie === true) {
|
|
persistedState.addMovie.defaults.monitor = 'movieOnly';
|
|
}
|
|
|
|
if (discoverMovie === true) {
|
|
persistedState.discoverMovie.defaults.monitor = 'movieOnly';
|
|
}
|
|
|
|
if (addMovie === false) {
|
|
persistedState.addMovie.defaults.monitor = 'none';
|
|
}
|
|
|
|
if (discoverMovie === false) {
|
|
persistedState.discoverMovie.defaults.monitor = 'none';
|
|
}
|
|
}
|