Ensure that a dismissed usage alert toast stays dismissed

This commit is contained in:
Will Hunt 2021-02-23 12:51:47 +00:00
parent 0daed98627
commit aa86c1d751
2 changed files with 22 additions and 4 deletions

View file

@ -23,7 +23,7 @@ import {messageForResourceLimitError} from "../utils/ErrorUtils";
const TOAST_KEY = "serverlimit";
export const showToast = (limitType: string, adminContact?: string, syncError?: boolean) => {
export const showToast = (limitType: string, onHideToast: () => void, adminContact?: string, syncError?: boolean) => {
const errorText = messageForResourceLimitError(limitType, adminContact, {
'monthly_active_user': _td("Your homeserver has exceeded its user limit."),
'': _td("Your homeserver has exceeded one of its resource limits."),
@ -38,7 +38,10 @@ export const showToast = (limitType: string, adminContact?: string, syncError?:
props: {
description: <React.Fragment>{errorText} {contactText}</React.Fragment>,
acceptLabel: _t("Ok"),
onAccept: hideToast,
onAccept: () => {
hideToast()
onHideToast()
},
},
component: GenericToast,
priority: 70,