Merge pull request #2033 from thelounge/xpaw/fix-default-theme

Fix default theme not being correct
This commit is contained in:
Jérémie Astori 2018-02-06 00:26:14 -05:00 committed by GitHub
commit bbaea66d11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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];