Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Oct 9, 2022
1 parent 0c85f09 commit 74d3a04
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
17 changes: 14 additions & 3 deletions layouts/bookmarks/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ setTimeout(async () => {
if(!vars) {
await loadVars();
}

// weird bug
try {
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
} catch(e) {
setTimeout(() => {
location.reload();
}, 50);
console.error(e);
return;
}
// tweet hotkeys
if(!vars.disableHotkeys) {
let tle = document.getElementById('timeline');
Expand Down Expand Up @@ -282,9 +295,7 @@ setTimeout(async () => {
});
});
});
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});


// Run
updateUserData();
Expand Down
16 changes: 12 additions & 4 deletions layouts/lists/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,21 @@ setTimeout(async () => {
if(!vars) {
await loadVars();
}
// weird bug
if(!document.getElementById('wtf-refresh')) {
// weird bug
location.reload();
}
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
try {
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
} catch(e) {
setTimeout(() => {
location.reload();
}, 50);
console.error(e);
return;
}
window.addEventListener("popstate", async () => {
cursor = undefined;
updateSubpage();
Expand Down
15 changes: 12 additions & 3 deletions layouts/settings/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,18 @@ setTimeout(async () => {
if(!vars) {
await loadVars();
}
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
// weird bug
try {
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
} catch(e) {
setTimeout(() => {
location.reload();
}, 50);
console.error(e);
return;
}

const fontCheck = new Set([
// Windows 10
Expand Down

0 comments on commit 74d3a04

Please sign in to comment.