Internalize algorithm updates in the new room list store
Fixes https://github.com/vector-im/riot-web/issues/14411 The act of setting/changing the algorithm was causing the update function to be marked, meaning we wouldn't trigger an update until something else happened later. To get around this, and still support internal functions spamming calls without multiple updates, we simply move the guts to an internalized function and make the public interface do a trigger.
This commit is contained in:
parent
e6c7e7c28e
commit
0e49c4343c
2 changed files with 12 additions and 15 deletions
|
@ -53,15 +53,4 @@ export class MarkedExecution {
|
|||
this.reset(); // reset first just in case the fn() causes a trigger()
|
||||
this.fn();
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers the function if a mark() call would mark it. If the function
|
||||
* has already been marked this will do nothing.
|
||||
*/
|
||||
public triggerIfWillMark() {
|
||||
if (!this.marked) {
|
||||
this.mark();
|
||||
this.trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue