Snapcast fully operational

This commit is contained in:
James Barnsley
2019-10-30 06:42:11 +13:00
parent 88a5efaa05
commit 658b828c41
14 changed files with 6440 additions and 10693 deletions

View File

@ -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;