Save theme settings (Dark Mode) persistent.
How can I save these settings in local storage and set them correctly again when I start the app.
Code for the toggle works, but not persitent yet:
$$('input[name="color-radio"]').on("change", function() {
if (this.checked) {
$$(".view").attr("class", "view view-main view-init");
$$(".view").addClass("color-theme-" + $$(this).val());
if ($$(".toggle input")[0].checked) {
$$(".view").addClass("theme-dark");
}
}
});
$$(".toggle input").on("change", function() {
if (this.checked) {
$$(".view").addClass("theme-dark");
} else {
$$(".view").removeClass("theme-dark");
}
});