Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubito committed Jul 11, 2023
2 parents 272c96d + 77d1283 commit c1c03a8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/albums.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class AlbumSet {
this._set.add(id)
}

/** @param {string} id */
delete(id) {
this._set.delete(id)
}

/** @param {AlbumSet} albumSet */
append(albumSet) {
for (const id of albumSet._set) this._set.add(id)
Expand Down
2 changes: 2 additions & 0 deletions src/sagas/root.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fork, take, takeEvery, takeLeading } from 'redux-saga/effects'
import { REHYDRATE } from 'redux-persist'
import {
applyLabelBlocklist,
authorize,
authorizeError,
createPlaylist,
Expand Down Expand Up @@ -32,6 +33,7 @@ export function* rootSaga() {
yield takeEvery(reset.type, deleteAuthData)
yield takeEvery(reset.type, albumsNew.clear)
yield takeEvery(reset.type, albumsHistory.clear)
yield takeEvery(applyLabelBlocklist.type, albumsNew.persist)
yield takeEvery(authorizeError.type, authorizeErrorSaga)
yield takeLeading(authorize.type, authorizeSaga)
yield takeLeadingCancellable(sync.type, syncCancel.type, syncSaga)
Expand Down
6 changes: 5 additions & 1 deletion src/state/reducer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createReducer } from '@reduxjs/toolkit'
import { albumsNew } from 'albums'
import { AlbumGroup, ArtistSource, GroupColorSchemes, ReleasesOrder } from 'enums'
import { deleteLabels } from 'helpers'
import {
Expand Down Expand Up @@ -215,7 +216,10 @@ const rootReducer = createReducer(INITIAL_STATE, (builder) => {
})
.addCase(applyLabelBlocklist, (state) => {
const deletedIds = deleteLabels(state.albums, state.settings.labelBlocklist)
for (const id of deletedIds) delete state.favorites[id]
for (const id of deletedIds) {
albumsNew.delete(id)
delete state.favorites[id]
}
})
.addCase(setLabelBlocklistHeight, (state, action) => {
state.labelBlocklistHeight = action.payload
Expand Down

0 comments on commit c1c03a8

Please sign in to comment.