Enhance preset saving and loading to include historyPersistence

This commit is contained in:
tomt610
2026-01-09 21:05:11 +00:00
parent fea59efe4e
commit ecb5d74d6e
2 changed files with 23 additions and 13 deletions
+2 -10
View File
@@ -490,18 +490,10 @@ function migrateTrackerPreset(config) {
// Add persistInHistory to infoBox widgets if missing (v3.4.0)
if (migrated.infoBox && migrated.infoBox.widgets) {
const defaultPersistence = {
date: true,
weather: true,
temperature: false,
time: true,
location: true,
recentEvents: false
};
for (const [widgetId, widget] of Object.entries(migrated.infoBox.widgets)) {
if (widget.persistInHistory === undefined) {
widget.persistInHistory = defaultPersistence[widgetId] ?? false;
// Default to false for backwards compatibility - user must explicitly enable
widget.persistInHistory = false;
}
}
}