1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-22 21:04:08 +02:00

enhance(frontend): improve enableInfiniteScroll stability

Close #16318
This commit is contained in:
syuilo
2025-08-15 12:40:37 +09:00
parent 7d30768769
commit bae92a944d
4 changed files with 7 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { throttle } from 'throttle-debounce';
import type { Directive } from 'vue';
export default {
@@ -10,12 +11,14 @@ export default {
const fn = binding.value;
if (fn == null) return;
const observer = new IntersectionObserver(entries => {
const check = throttle(1000, (entries) => {
if (entries.some(entry => entry.isIntersecting)) {
fn();
}
});
const observer = new IntersectionObserver(check);
observer.observe(src);
src._observer_ = observer;