From 7617286d3e1a848cbe74261e84b222992ee994b6 Mon Sep 17 00:00:00 2001 From: Mauro Balades Date: Sat, 17 Aug 2024 17:07:02 +0200 Subject: [PATCH] refactor: Add lazy loading for images in ZenThemeMarketplaceParent.sys.mjs Improve page load performance by adding lazy loading for images in the ZenThemeMarketplaceParent.sys.mjs file. The code now downloads the preferences.json file if it exists in the theme object. This enhancement optimizes the loading of images and improves the overall user experience. --- src/actors/ZenThemeMarketplaceParent.sys.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/actors/ZenThemeMarketplaceParent.sys.mjs b/src/actors/ZenThemeMarketplaceParent.sys.mjs index 30d3133..2ba434b 100644 --- a/src/actors/ZenThemeMarketplaceParent.sys.mjs +++ b/src/actors/ZenThemeMarketplaceParent.sys.mjs @@ -70,6 +70,9 @@ export class ZenThemeMarketplaceParent extends JSWindowActorParent { await IOUtils.makeDirectory(themePath, { ignoreExisting: true }); await this.downloadUrlToFile(theme.style, PathUtils.join(themePath, "chrome.css")); await this.downloadUrlToFile(theme.readme, PathUtils.join(themePath, "readme.md")); + if (theme.preferences) { + await this.downloadUrlToFile(theme.preferences, PathUtils.join(themePath, "preferences.json")); + } } get themesRootPath() {