mirror of
https://github.com/thelounge/thelounge
synced 2024-11-29 07:20:25 +00:00
c26de4cf6a
Co-Authored-By: Tim Miller-Williams <timmw@users.noreply.github.com>
37 lines
700 B
JavaScript
37 lines
700 B
JavaScript
function createMutator(propertyName) {
|
|
return [
|
|
propertyName,
|
|
(state, value) => {
|
|
state[propertyName] = value;
|
|
},
|
|
];
|
|
}
|
|
|
|
function createMutators(keys) {
|
|
return Object.fromEntries(keys.map(createMutator));
|
|
}
|
|
|
|
const state = {
|
|
syncSettings: false,
|
|
advanced: false,
|
|
autocomplete: true,
|
|
nickPostfix: "",
|
|
coloredNicks: true,
|
|
desktopNotifications: false,
|
|
highlights: "",
|
|
links: true,
|
|
motd: true,
|
|
notification: true,
|
|
notifyAllMessages: false,
|
|
showSeconds: false,
|
|
statusMessages: "condensed",
|
|
theme: document.getElementById("theme").dataset.serverTheme,
|
|
media: true,
|
|
userStyles: "",
|
|
};
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state,
|
|
mutations: createMutators(Object.keys(state)),
|
|
};
|