Snapcast fully operational
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
|
||||
const helpers = require('../../helpers.js');
|
||||
|
||||
const localstorageMiddleware = (function () {
|
||||
const localstorageMiddleware = (function () {
|
||||
/**
|
||||
* The actual middleware inteceptor
|
||||
* */
|
||||
return (store) => (next) => (action) => {
|
||||
return (store) => (next) => (action) => {
|
||||
// proceed as normal first
|
||||
// this way, any reducers and middleware do their thing BEFORE we store our new state
|
||||
next(action);
|
||||
@ -14,7 +14,7 @@ const localstorageMiddleware = (function () {
|
||||
window._store = store;
|
||||
|
||||
// if debug enabled
|
||||
if (store.getState().ui.log_actions) {
|
||||
if (store.getState().ui.log_actions) {
|
||||
const ignored_actions = [
|
||||
'START_LOADING',
|
||||
'STOP_LOADING',
|
||||
@ -26,7 +26,7 @@ const localstorageMiddleware = (function () {
|
||||
}
|
||||
}
|
||||
|
||||
switch (action.type) {
|
||||
switch (action.type) {
|
||||
case 'PUSHER_CONNECTED':
|
||||
helpers.setStorage(
|
||||
'pusher',
|
||||
@ -236,6 +236,13 @@ const localstorageMiddleware = (function () {
|
||||
);
|
||||
break;
|
||||
|
||||
case 'SNAPCAST_SET':
|
||||
helpers.setStorage(
|
||||
'snapcast',
|
||||
action.data,
|
||||
);
|
||||
break;
|
||||
|
||||
case 'SNAPCAST_COMMANDS_UPDATED':
|
||||
helpers.setStorage(
|
||||
'snapcast',
|
||||
@ -290,7 +297,7 @@ const localstorageMiddleware = (function () {
|
||||
break;
|
||||
*/
|
||||
}
|
||||
};
|
||||
};
|
||||
}());
|
||||
|
||||
export default localstorageMiddleware;
|
||||
|
||||
Reference in New Issue
Block a user