mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-14 09:06:38 +03:00
18 lines
366 B
JavaScript
18 lines
366 B
JavaScript
import { ALBUM_MODE_GRID, ALBUM_MODE_TABLE } from '../actions'
|
|
|
|
export const albumViewReducer = (
|
|
previousState = {
|
|
grid: true,
|
|
},
|
|
payload
|
|
) => {
|
|
const { type } = payload
|
|
switch (type) {
|
|
case ALBUM_MODE_GRID:
|
|
case ALBUM_MODE_TABLE:
|
|
return { ...previousState, grid: type === ALBUM_MODE_GRID }
|
|
default:
|
|
return previousState
|
|
}
|
|
}
|