Update index.js

trigger only  after document readstate change to complete
This commit is contained in:
Neil deGrasse Tyson 2024-11-02 14:01:20 +08:00 committed by GitHub
parent cb790fd466
commit 72bc3299e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -223,6 +223,7 @@
};
const init = () => {
if(document.readyState==='complete'){
if (!initialized) {
track();
handlePathChanges();
@ -230,6 +231,7 @@
handleClicks();
initialized = true;
}
}
};
const track = (obj, data) => {