mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-30 14:34:09 +02:00
Make memory cleanup detect recent activity and fix modals
This commit is contained in:
parent
9f0997be1a
commit
fd2cf5d4d7
@ -1110,9 +1110,19 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(function(){
|
||||||
|
var lastActivity = Date.now();
|
||||||
|
|
||||||
|
$(document).click(function(e){
|
||||||
|
lastActivity = Date.now();
|
||||||
|
});
|
||||||
|
|
||||||
window.TDGF_tryRunCleanup = function(){
|
window.TDGF_tryRunCleanup = function(){
|
||||||
|
// no recent activity
|
||||||
|
return false if Date.now()-lastActivity < 15e3;
|
||||||
|
|
||||||
// no modals are visible
|
// no modals are visible
|
||||||
return false if $("#open-modal").is(":visible") || !$(".js-modals-container").is(":empty");
|
return false if $(".js-modal").is(":visible") || !$(".js-modals-container").is(":empty");
|
||||||
|
|
||||||
// all columns are in a default state
|
// all columns are in a default state
|
||||||
return false if $("section.js-column").is(".is-shifted-1,.is-shifted-2");
|
return false if $("section.js-column").is(".is-shifted-1,.is-shifted-2");
|
||||||
@ -1127,6 +1137,7 @@
|
|||||||
window.TDGF_reload();
|
window.TDGF_reload();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
if (window.TD_SESSION && window.TD_SESSION.gc){
|
if (window.TD_SESSION && window.TD_SESSION.gc){
|
||||||
var state;
|
var state;
|
||||||
|
Loading…
Reference in New Issue
Block a user