Skip to content

Commit

Permalink
prevent double onLoad
Browse files Browse the repository at this point in the history
  • Loading branch information
vintikzzz committed Nov 11, 2024
1 parent 1f44c31 commit e3f8c74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/src/js/app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ window.progress = {
import {bindAsync} from '../lib/async';
import initAsyncView from '../lib/asyncView';


const initTheme = (await import('../lib/themeSelector')).initTheme;
window.loaded = false;
function onLoad() {
if (window.loaded) return;
window.loaded = true;
initTheme(document.querySelector('[data-toggle-theme]'));
document.body.style.display = 'flex';
hideProgress();
Expand Down

0 comments on commit e3f8c74

Please sign in to comment.