feat: Update to version 1.2.0.0 with script injection improvements and fallback support
This commit is contained in:
@@ -162,6 +162,7 @@ async function initializeTheme() {
|
||||
automateThemeSelection = config.automateSeasonSelection;
|
||||
defaultTheme = config.selectedSeason;
|
||||
window.SeasonalsPluginConfig = config;
|
||||
console.log('Seasonals Config loaded:', config);
|
||||
} else {
|
||||
console.error('Failed to fetch Seasonals config');
|
||||
}
|
||||
@@ -170,7 +171,7 @@ async function initializeTheme() {
|
||||
}
|
||||
|
||||
let currentTheme;
|
||||
if (!automateThemeSelection) {
|
||||
if (automateThemeSelection === false) {
|
||||
currentTheme = defaultTheme;
|
||||
} else {
|
||||
currentTheme = determineCurrentTheme();
|
||||
@@ -178,7 +179,7 @@ async function initializeTheme() {
|
||||
|
||||
console.log(`Selected theme: ${currentTheme}`);
|
||||
|
||||
if (currentTheme === 'none') {
|
||||
if (!currentTheme || currentTheme === 'none') {
|
||||
console.log('No theme selected.');
|
||||
removeSelf();
|
||||
return;
|
||||
@@ -200,8 +201,9 @@ async function initializeTheme() {
|
||||
removeSelf();
|
||||
}
|
||||
|
||||
|
||||
//document.addEventListener('DOMContentLoaded', initializeTheme);
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Ensure DOM is ready before initializing
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', initializeTheme);
|
||||
} else {
|
||||
initializeTheme();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user