Merge branches 't3chguy/toasts3' and 't3chguy/toasts3_1' of github.com:matrix-org/matrix-react-sdk into t3chguy/toasts3_1

This commit is contained in:
Michael Telatynski 2020-05-23 11:22:19 +01:00
commit 22dba5f794
7 changed files with 41 additions and 41 deletions

View file

@ -59,7 +59,7 @@ export default class ToastStore extends EventEmitter {
const oldIndex = this.toasts.findIndex(t => t.key === newToast.key);
if (oldIndex === -1) {
let newIndex = this.toasts.length;
while (newIndex > 0 && this.toasts[newIndex - 1].priority > newToast.priority) --newIndex;
while (newIndex > 0 && this.toasts[newIndex - 1].priority < newToast.priority) --newIndex;
this.toasts.splice(newIndex, 0, newToast);
} else {
this.toasts[oldIndex] = newToast;