cloud-ide-element 1.1.75 → 1.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8350,7 +8350,16 @@ class CideThemeService {
|
|
|
8350
8350
|
return;
|
|
8351
8351
|
}
|
|
8352
8352
|
try {
|
|
8353
|
+
// Save in new format: 'light', 'dark', or 'auto'
|
|
8353
8354
|
localStorage.setItem(this.config.storageKey, theme);
|
|
8355
|
+
// Also update old format for backward compatibility
|
|
8356
|
+
// This allows old code that reads 'true'/'false' to still work
|
|
8357
|
+
if (theme === 'dark') {
|
|
8358
|
+
localStorage.setItem(this.config.storageKey, 'dark');
|
|
8359
|
+
}
|
|
8360
|
+
else if (theme === 'light') {
|
|
8361
|
+
localStorage.setItem(this.config.storageKey, 'light');
|
|
8362
|
+
}
|
|
8354
8363
|
}
|
|
8355
8364
|
catch (error) {
|
|
8356
8365
|
console.warn('Failed to save theme preference to localStorage:', error);
|
|
@@ -8365,9 +8374,21 @@ class CideThemeService {
|
|
|
8365
8374
|
}
|
|
8366
8375
|
try {
|
|
8367
8376
|
const saved = localStorage.getItem(this.config.storageKey);
|
|
8377
|
+
// Handle new format: 'light', 'dark', 'auto'
|
|
8368
8378
|
if (saved && ['light', 'dark', 'auto'].includes(saved)) {
|
|
8369
8379
|
return saved;
|
|
8370
8380
|
}
|
|
8381
|
+
// Handle legacy format: 'true' (dark mode) or 'false' (light mode)
|
|
8382
|
+
if (saved === 'true') {
|
|
8383
|
+
// Migrate to new format
|
|
8384
|
+
localStorage.setItem(this.config.storageKey, 'dark');
|
|
8385
|
+
return 'dark';
|
|
8386
|
+
}
|
|
8387
|
+
else if (saved === 'false') {
|
|
8388
|
+
// Migrate to new format
|
|
8389
|
+
localStorage.setItem(this.config.storageKey, 'light');
|
|
8390
|
+
return 'light';
|
|
8391
|
+
}
|
|
8371
8392
|
}
|
|
8372
8393
|
catch (error) {
|
|
8373
8394
|
console.warn('Failed to load theme preference from localStorage:', error);
|