mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-03 04:21:05 -08:00
feat: auto reload page if wiki not loaded
This commit is contained in:
parent
63041ef460
commit
8490cccadb
1 changed files with 12 additions and 0 deletions
|
|
@ -47,6 +47,18 @@ const handleLoaded = (event) => {
|
|||
loadDarkReader();
|
||||
});
|
||||
|
||||
// reload page if it is not loaded yet
|
||||
const CHECK_LOADED_INTERVAL = 1000 * 3;
|
||||
function refresh() {
|
||||
const serverNotStarted = !document || document.querySelector('.tc-site-title') === null;
|
||||
if (serverNotStarted) {
|
||||
window.location.reload(true);
|
||||
} else {
|
||||
setTimeout(refresh, CHECK_LOADED_INTERVAL);
|
||||
}
|
||||
}
|
||||
setTimeout(refresh, CHECK_LOADED_INTERVAL);
|
||||
|
||||
const jsCodeInjection = ipcRenderer.sendSync('get-preference', 'jsCodeInjection');
|
||||
const allowNodeInJsCodeInjection = ipcRenderer.sendSync('get-preference', 'allowNodeInJsCodeInjection');
|
||||
const cssCodeInjection = ipcRenderer.sendSync('get-preference', 'cssCodeInjection');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue