fix: add pauseScrollEvents method to ScrollManagerV2

This commit is contained in:
Игорь Надеин 2026-01-13 13:18:33 +03:00
parent 8fa7cb2eae
commit 3e97ca2ac9

View File

@ -359,6 +359,28 @@ export class ScrollManagerV2 {
});
}
/**
* Приостанавливает обработку scroll событий на указанное время
* @param {number} duration - Длительность паузы в миллисекундах
*/
pauseScrollEvents(duration = 1000) {
console.log('[ScrollManagerV2] ⏸️ Pausing scroll events for', duration, 'ms');
// Сохраняем оригинальный debounced handler
const originalHandler = this._debouncedLoadHistory;
// Заменяем на no-op функцию
this._debouncedLoadHistory = () => {
console.log('[ScrollManagerV2] 🚫 Scroll events paused, ignoring history load');
};
// Восстанавливаем оригинальный handler через указанное время
setTimeout(() => {
this._debouncedLoadHistory = originalHandler;
console.log('[ScrollManagerV2] ▶️ Scroll events resumed');
}, duration);
}
/**
* Проверяет, находится ли пользователь внизу
* @param {number} [threshold] - Порог в пикселях