You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Add jsdoc explaining ordering behaviour
This commit is contained in:
@@ -39,6 +39,15 @@ export default class ToastStore extends EventEmitter {
|
|||||||
this._toasts = [];
|
this._toasts = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add or replace a toast
|
||||||
|
* If a toast with the same toastKey already exists, the given toast will replace it
|
||||||
|
* Toasts are always added underneath any toasts of the same priority, so existing
|
||||||
|
* toasts stay at the top unless a higher priority one arrives (better to not change the
|
||||||
|
* toast unless necessary).
|
||||||
|
*
|
||||||
|
* @param {boject} newToast The new toast
|
||||||
|
*/
|
||||||
addOrReplaceToast(newToast) {
|
addOrReplaceToast(newToast) {
|
||||||
if (newToast.priority === undefined) newToast.priority = ToastStore.PRIORITY_DEFAULT;
|
if (newToast.priority === undefined) newToast.priority = ToastStore.PRIORITY_DEFAULT;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user