mirror of
https://github.com/flarum/core.git
synced 2025-07-30 13:10:24 +02:00
Refactor start/endComputation into lazyRedraw method
This commit is contained in:
@@ -179,12 +179,7 @@ export default class DiscussionList extends Component {
|
||||
this.loading = false;
|
||||
this.moreResults = !!results.payload.links.next;
|
||||
|
||||
// Since this may be called during the component's constructor, i.e. in the
|
||||
// middle of a redraw, forcing another redraw would not bode well. Instead
|
||||
// we start/end a computation so Mithril will only redraw if it isn't
|
||||
// already doing so.
|
||||
m.startComputation();
|
||||
m.endComputation();
|
||||
m.lazyRedraw();
|
||||
|
||||
return results;
|
||||
}
|
||||
|
Reference in New Issue
Block a user