diff --git a/src/components/structures/ToastContainer.js b/src/components/structures/ToastContainer.js index b8ced1e9de..a8dca35747 100644 --- a/src/components/structures/ToastContainer.js +++ b/src/components/structures/ToastContainer.js @@ -50,35 +50,34 @@ export default class ToastContainer extends React.Component { render() { const totalCount = this.state.toasts.length; - if (totalCount === 0) { - return null; - } const isStacked = totalCount > 1; - const topToast = this.state.toasts[0]; - const {title, icon, key, component, props} = topToast; + let toast; + if (totalCount !== 0) { + const topToast = this.state.toasts[0]; + const {title, icon, key, component, props} = topToast; + const toastClasses = classNames("mx_Toast_toast", { + "mx_Toast_hasIcon": icon, + [`mx_Toast_icon_${icon}`]: icon, + }); + const countIndicator = isStacked ? _t(" (1/%(totalCount)s)", {totalCount}) : null; + + const toastProps = Object.assign({}, props, { + dismiss: this.dismissTopToast, + key, + }); + toast = (