Add dismiss button to rebrand toast
Fixes https://github.com/vector-im/riot-web/issues/14575
This commit is contained in:
parent
4db0d94fb6
commit
6fb257df7a
1 changed files with 11 additions and 0 deletions
|
@ -114,6 +114,11 @@ export default class RebrandListener {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onOneTimeToastDismiss = async () => {
|
||||||
|
localStorage.setItem('mx_rename_dialog_dismissed', 'true');
|
||||||
|
this.recheck();
|
||||||
|
};
|
||||||
|
|
||||||
onNagTimerFired = () => {
|
onNagTimerFired = () => {
|
||||||
this._reshowTimer = null;
|
this._reshowTimer = null;
|
||||||
this.nagAgainAt = null;
|
this.nagAgainAt = null;
|
||||||
|
@ -143,10 +148,14 @@ export default class RebrandListener {
|
||||||
|
|
||||||
if (nagToast || oneTimeToast) {
|
if (nagToast || oneTimeToast) {
|
||||||
let description;
|
let description;
|
||||||
|
let rejectLabel = null;
|
||||||
|
let onReject = null;
|
||||||
if (nagToast) {
|
if (nagToast) {
|
||||||
description = _t("Use your account to sign in to the latest version");
|
description = _t("Use your account to sign in to the latest version");
|
||||||
} else {
|
} else {
|
||||||
description = _t("We’re excited to announce Riot is now Element");
|
description = _t("We’re excited to announce Riot is now Element");
|
||||||
|
rejectLabel = _t("Dismiss");
|
||||||
|
onReject = this.onOneTimeToastDismiss;
|
||||||
}
|
}
|
||||||
|
|
||||||
ToastStore.sharedInstance().addOrReplaceToast({
|
ToastStore.sharedInstance().addOrReplaceToast({
|
||||||
|
@ -157,6 +166,8 @@ export default class RebrandListener {
|
||||||
description,
|
description,
|
||||||
acceptLabel: _t("Learn More"),
|
acceptLabel: _t("Learn More"),
|
||||||
onAccept: nagToast ? this.onNagToastLearnMore : this.onOneTimeToastLearnMore,
|
onAccept: nagToast ? this.onNagToastLearnMore : this.onOneTimeToastLearnMore,
|
||||||
|
rejectLabel,
|
||||||
|
onReject,
|
||||||
},
|
},
|
||||||
component: GenericToast,
|
component: GenericToast,
|
||||||
priority: 20,
|
priority: 20,
|
||||||
|
|
Loading…
Reference in a new issue