🥅 Catch error caused by empty config

This commit is contained in:
Alicia Sykes
2024-04-27 00:32:01 +01:00
parent 4594c99b57
commit 9e6fb17d93
2 changed files with 13 additions and 5 deletions

View File

@@ -116,7 +116,8 @@ export default {
},
mounted() {
const jsonData = { ...this.config };
jsonData.sections = jsonData.sections.map(({ filteredItems, ...section }) => section);
jsonData.sections = (jsonData.sections || []).map(({ filteredItems, ...section }) => section);
if (!jsonData.pageInfo) jsonData.pageInfo = { title: 'Dashy' };
this.jsonData = jsonData;
if (!this.allowWriteToDisk) this.saveMode = 'local';
},