Fix default theme not being correct

This commit is contained in:
Pavel Djundik 2018-02-04 19:32:04 +02:00
parent dbb51e0f46
commit 60777b9b1f

View file

@ -22,12 +22,14 @@ const options = {
notifyAllMessages: false,
showSeconds: false,
statusMessages: "condensed",
theme: $("#theme").prop("href").replace(/^themes\/(.*).css$/, "$1"), // Extracts default theme name, set on the server configuration
theme: $("#theme").prop("href").match(/themes\/(.*?)\.css$/), // TODO: Make this a data attribute in v3
media: true,
userStyles: userStyles.text(),
};
let userOptions = JSON.parse(storage.get("settings")) || {};
options.theme = options.theme ? options.theme[1] : "example"; // TODO: Remove in v3
for (const key in options) {
if (userOptions[key] !== undefined) {
options[key] = userOptions[key];