Don't use ts-ignore. It is hiding real errors

We are passing the wrong arguments to
addVisualEditorHooks

Bug: T297119
Change-Id: I2f8ced4513a1e5fcca2a2a2393cbb8fd7a3db388
This commit is contained in:
jdlrobson 2021-12-15 15:19:04 -08:00 committed by Bartosz Dziewoński
parent d20e32f8d1
commit d79dbf37c9
1 changed files with 2 additions and 5 deletions

View File

@ -428,22 +428,19 @@ function isStickyHeaderAllowed() {
* @param {IntersectionObserver} observer
*/
function initStickyHeader( observer ) {
if ( !isStickyHeaderAllowed() ) {
if ( !isStickyHeaderAllowed() || !header || !userMenu || !stickyIntersection ) {
return;
}
makeStickyHeaderFunctional(
// @ts-ignore
header,
userMenu,
userMenuStickyContainer,
observer,
stickyIntersection
);
// @ts-ignore
setupSearchIfNeeded( header );
// @ts-ignore
addVisualEditorHooks( header, stickyIntersection, observer );
addVisualEditorHooks( stickyIntersection, observer );
// Make sure ULS outside sticky header disables the sticky header behaviour.
// @ts-ignore