Clean up toast logic in AppActions

This commit is contained in:
Berkeley Martinez
2016-01-09 22:49:16 -08:00
parent bb2daa2a1f
commit 2f068261c6

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
}
};
}
};
},