Chat: disconnect IntersectionObserver (#14091)
This commit is contained in:
parent
285462baac
commit
c2a7038406
1 changed files with 11 additions and 0 deletions
|
|
@ -53,7 +53,18 @@ export function setupObserver(callback) {
|
|||
const somethingObserver = new IntersectionObserver(callback, {
|
||||
threshold: [0, 1],
|
||||
});
|
||||
|
||||
somethingObserver.observe(sentinel);
|
||||
|
||||
window.addEventListener('beforeunload', () => {
|
||||
somethingObserver.disconnect();
|
||||
});
|
||||
|
||||
if (typeof instantClick !== 'undefined') {
|
||||
InstantClick.on('change', () => {
|
||||
somethingObserver.disconnect();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function hideMessages(messages, userId) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue