fix: move cardsLoad() after currentLang init to avoid TDZ error
This commit is contained in:
+2
-3
@@ -3638,9 +3638,6 @@ function pysimCustomImport() {
|
||||
// Init custom files
|
||||
pysimCustomLoad();
|
||||
|
||||
// Init cards
|
||||
cardsLoad();
|
||||
|
||||
// Init sub-tab pills
|
||||
document.querySelectorAll('.pysim-subtab').forEach(btn => {
|
||||
btn.addEventListener('click', () => pysimSwitchSubtab(btn.dataset.pysimSub));
|
||||
@@ -3763,6 +3760,8 @@ const userLang = (navigator.language || '').split('-')[0];
|
||||
currentLang = localStorage.getItem('lang') || (userLang === 'ru' ? 'ru' : 'en');
|
||||
document.getElementById('lang-btn').textContent = currentLang.toUpperCase();
|
||||
|
||||
cardsLoad();
|
||||
|
||||
if (localStorage.getItem('theme') === 'dark' ||
|
||||
(!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
document.documentElement.classList.add('dark');
|
||||
|
||||
Reference in New Issue
Block a user