1
0
mirror of https://github.com/element-hq/element-web.git synced 2025-11-28 09:24:05 +03:00

Minor code quality updates for ScrollPanel (#9639)

* Minor code quality updates for ScrollPanel

and removal of unused function `scrollRelative` in MessagePanel (discovered when changing the scrollRelative types in ScrollPanel).

Changes:
* Clean up logging a bit, make it clearer
* Remove dead code
* Add extra types for tsc --strict compliance (not complete)
* Fix IDE warnings around spelling and missing awaits/promise return values
* Modernize usage of logging

* Fix more tsc --strict errors while we're here

* It's a good thing we have a linter

* Fix even more strict errors
This commit is contained in:
Travis Ralston
2022-11-29 07:43:14 -07:00
committed by GitHub
parent f642765149
commit 09282d9f36
2 changed files with 55 additions and 56 deletions

View File

@@ -183,7 +183,7 @@ interface IProps {
onFillRequest?(backwards: boolean): Promise<boolean>;
// helper function to access relations for an event
onUnfillRequest?(backwards: boolean, scrollToken: string): void;
onUnfillRequest?(backwards: boolean, scrollToken: string | null): void;
getRelationsForEvent?: GetRelationsForEvent;
@@ -413,17 +413,6 @@ export default class MessagePanel extends React.Component<IProps, IState> {
}
}
/**
* Page up/down.
*
* @param {number} mult: -1 to page up, +1 to page down
*/
public scrollRelative(mult: number): void {
if (this.scrollPanel.current) {
this.scrollPanel.current.scrollRelative(mult);
}
}
/**
* Scroll up/down in response to a scroll key
*