Closes #842 - Toast messages hanging

This commit is contained in:
Tom Moor
2019-01-09 22:41:06 -08:00
parent c54c3d963e
commit 23b227c352
6 changed files with 60 additions and 58 deletions

View File

@ -10,20 +10,16 @@ type Props = {
};
@observer
class Toasts extends React.Component<Props> {
handleClose = (index: number) => {
this.props.ui.removeToast(index);
};
render() {
const { ui } = this.props;
return (
<List>
{ui.toasts.map((toast, index) => (
{ui.orderedToasts.map(toast => (
<Toast
key={index}
onRequestClose={this.handleClose.bind(this, index)}
key={toast.id}
toast={toast}
onRequestClose={() => ui.removeToast(toast.id)}
/>
))}
</List>