improvement: change messages states to useReducer

This commit is contained in:
canove
2020-08-18 21:39:41 -03:00
parent 4ca4a24296
commit 83ed1752bb
2 changed files with 57 additions and 42 deletions

View File

@@ -182,7 +182,7 @@ const reducer = (state, action) => {
state[ticketIndex] = ticket;
state.unshift(state.splice(ticketIndex, 1)[0]);
} else {
state.push(ticket);
state.unshift(ticket);
}
return [...state];
}