Remove sanity check from requestAnimationFrame

It should be in all major browsers as of years ago, and we use it unguarded elsewhere in the app. The performance benefits of it appear to be worthwhile enough to keep it, though it's not a perfect solution.
This commit is contained in:
Travis Ralston 2020-07-08 12:17:51 -06:00
parent 3abf1586f9
commit 6e20850567

View file

@ -115,20 +115,12 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
};
private handleStickyHeaders(list: HTMLDivElement) {
// TODO: Evaluate if this has any performance benefit or detriment.
// See https://github.com/vector-im/riot-web/issues/14035
if (this.isDoingStickyHeaders) return;
this.isDoingStickyHeaders = true;
if (window.requestAnimationFrame) {
window.requestAnimationFrame(() => {
this.doStickyHeaders(list);
this.isDoingStickyHeaders = false;
});
} else {
window.requestAnimationFrame(() => {
this.doStickyHeaders(list);
this.isDoingStickyHeaders = false;
}
});
}
private doStickyHeaders(list: HTMLDivElement) {