From afeb36253c1c851bd1cf9fba7732a7bdbeb02fbc Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 25 Dec 2021 12:44:23 +0300 Subject: [PATCH] keep dummy sections --- manage/import-export.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manage/import-export.js b/manage/import-export.js index f6ad56db..77457d2f 100644 --- a/manage/import-export.js +++ b/manage/import-export.js @@ -350,9 +350,10 @@ async function exportToFile(e) { /** Stripping `sections`, `null` and empty objects */ function cleanupStyle(style) { const copy = {}; - for (const [key, val] of Object.entries(style)) { + for (let [key, val] of Object.entries(style)) { if (key === 'sections' - ? !style.usercssData + // Keeping dummy `sections` for compatibility with older Stylus + ? !style.usercssData || (val = [{code: ''}]) : typeof val !== 'object' || !isEmptyObj(val)) { copy[key] = val; }