mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-21 13:19:22 +01:00
Extra check if container if not clickable
This commit is contained in:
parent
ecb1be5776
commit
caeeffaa72
1 changed files with 9 additions and 4 deletions
|
@ -226,23 +226,28 @@ function Timeline({
|
||||||
|
|
||||||
const loadOrCheckUpdates = useCallback(
|
const loadOrCheckUpdates = useCallback(
|
||||||
async ({ disableIdleCheck = false } = {}) => {
|
async ({ disableIdleCheck = false } = {}) => {
|
||||||
console.log('✨ Load or check updates', {
|
const noPointers = scrollableRef.current
|
||||||
|
? getComputedStyle(scrollableRef.current).pointerEvents === 'none'
|
||||||
|
: false;
|
||||||
|
console.log('✨ Load or check updates', id, {
|
||||||
autoRefresh: snapStates.settings.autoRefresh,
|
autoRefresh: snapStates.settings.autoRefresh,
|
||||||
scrollTop: scrollableRef.current.scrollTop,
|
scrollTop: scrollableRef.current.scrollTop,
|
||||||
disableIdleCheck,
|
disableIdleCheck,
|
||||||
idle: window.__IDLE__,
|
idle: window.__IDLE__,
|
||||||
inBackground: inBackground(),
|
inBackground: inBackground(),
|
||||||
|
noPointers,
|
||||||
});
|
});
|
||||||
if (
|
if (
|
||||||
snapStates.settings.autoRefresh &&
|
snapStates.settings.autoRefresh &&
|
||||||
scrollableRef.current.scrollTop < 16 &&
|
scrollableRef.current.scrollTop < 16 &&
|
||||||
(disableIdleCheck || window.__IDLE__) &&
|
(disableIdleCheck || window.__IDLE__) &&
|
||||||
!inBackground()
|
!inBackground() &&
|
||||||
|
!noPointers
|
||||||
) {
|
) {
|
||||||
console.log('✨ Load updates', snapStates.settings.autoRefresh);
|
console.log('✨ Load updates', id, snapStates.settings.autoRefresh);
|
||||||
loadItems(true);
|
loadItems(true);
|
||||||
} else {
|
} else {
|
||||||
console.log('✨ Check updates', snapStates.settings.autoRefresh);
|
console.log('✨ Check updates', id, snapStates.settings.autoRefresh);
|
||||||
const hasUpdate = await checkForUpdates();
|
const hasUpdate = await checkForUpdates();
|
||||||
if (hasUpdate) {
|
if (hasUpdate) {
|
||||||
console.log('✨ Has new updates', id);
|
console.log('✨ Has new updates', id);
|
||||||
|
|
Loading…
Reference in a new issue