Lots of performance fixes

This commit is contained in:
Håvar Aambø Fosstveit
2019-04-03 16:20:17 +02:00
parent 168affbc57
commit e84af94544
16 changed files with 219 additions and 117 deletions
+2 -9
View File
@@ -25,6 +25,7 @@ const consumers = (state = initialState, action) =>
{
const { consumerId, originator } = action.payload;
const consumer = state[consumerId];
let newConsumer;
if (originator === 'local')
@@ -35,19 +36,11 @@ const consumers = (state = initialState, action) =>
return { ...state, [consumerId]: newConsumer };
}
case 'SET_CONSUMER_VOLUME':
{
const { consumerId, volume } = action.payload;
const consumer = state[consumerId];
const newConsumer = { ...consumer, volume };
return { ...state, [consumerId]: newConsumer };
}
case 'SET_CONSUMER_RESUMED':
{
const { consumerId, originator } = action.payload;
const consumer = state[consumerId];
let newConsumer;
if (originator === 'local')