Update stylePresets.js

This commit is contained in:
Aitor 2022-03-19 16:35:44 +01:00 committed by GitHub
parent ab3c8c9e04
commit 31b253e0a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,10 @@ const customPresetPrefix = "fmgStyle_";
}
async function applyStyleOnLoad() {
const desiredPreset = localStorage.getItem("presetStyle") || "default";
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const desiredPreset = urlParams.get("presetStyle") || localStorage.getItem("presetStyle") || "default";
const styleData = await getStylePreset(desiredPreset);
const [appliedPreset, style] = styleData;