Clean up toast logic in AppActions

pull/5960/head
Berkeley Martinez 2016-01-09 22:49:16 -08:00
parent f65b6472dd
commit a8ee090fea
1 changed files with 7 additions and 3 deletions

View File

@ -43,9 +43,13 @@ export default Actions({
toast(args) {
return {
transform(state) {
const id = state.toast && state.toast.id ? state.toast.id : 0;
const toast = { ...args, id: id + 1 };
return { ...state, toast };
return {
...state,
toast: {
...args,
id: state.toast && state.toast.id ? state.toast.id : 1
}
};
}
};
},