mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 12:16:53 +02:00
fix priority sorting to highest first
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
a822ab49d5
commit
d29ba5b597
@ -55,7 +55,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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user