New: Remember add import list exclusion when removing artists

(cherry picked from commit d8f6eaebdcf7e9b8170fe2baf1fe232fe02a1331)

Closes #3260
Closes #326
This commit is contained in:
Mark McDowall 2022-12-31 22:17:50 -08:00 committed by Bogdan
commit 28ac640103
3 changed files with 58 additions and 52 deletions

View file

@ -157,9 +157,16 @@ export const defaultState = {
items: [],
sortKey: 'sortName',
sortDirection: sortDirections.ASCENDING,
pendingChanges: {}
pendingChanges: {},
deleteOptions: {
addImportListExclusion: false
}
};
export const persistState = [
'artist.deleteOptions'
];
//
// Actions Types
@ -171,6 +178,8 @@ export const DELETE_ARTIST = 'artist/deleteArtist';
export const TOGGLE_ARTIST_MONITORED = 'artist/toggleArtistMonitored';
export const TOGGLE_ALBUM_MONITORED = 'artist/toggleAlbumMonitored';
export const SET_DELETE_OPTION = 'artist/setDeleteOption';
//
// Action Creators
@ -211,6 +220,8 @@ export const setArtistValue = createAction(SET_ARTIST_VALUE, (payload) => {
};
});
export const setDeleteOption = createAction(SET_DELETE_OPTION);
//
// Helpers
@ -340,6 +351,15 @@ export const actionHandlers = handleThunks({
export const reducers = createHandleActions({
[SET_ARTIST_VALUE]: createSetSettingValueReducer(section)
[SET_ARTIST_VALUE]: createSetSettingValueReducer(section),
[SET_DELETE_OPTION]: (state, { payload }) => {
return {
...state,
deleteOptions: {
...payload
}
};
}
}, defaultState, section);