From c26de4cf6af5ae8b5d9989e78f5adc727155fc06 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sun, 3 Nov 2019 20:05:19 +0200 Subject: [PATCH] Move options to vuex Co-Authored-By: Tim Miller-Williams --- client/components/Chat.vue | 6 +- client/components/ChatInput.vue | 2 +- client/components/LinkPreview.vue | 8 +- client/components/Message.vue | 2 +- client/components/MessageList.vue | 4 +- client/components/Windows/Settings.vue | 101 ++++++++++++----------- client/js/autocompletion.js | 5 +- client/js/options.js | 9 +- client/js/socket-events/configuration.js | 2 +- client/js/socket-events/msg.js | 7 +- client/js/socket-events/setting.js | 5 +- client/js/store-settings.js | 37 +++++++++ client/js/store.js | 10 ++- client/js/vue.js | 18 ---- 14 files changed, 124 insertions(+), 92 deletions(-) create mode 100644 client/js/store-settings.js diff --git a/client/components/Chat.vue b/client/components/Chat.vue index 3eda5c62..118e6982 100644 --- a/client/components/Chat.vue +++ b/client/components/Chat.vue @@ -4,9 +4,9 @@ id="chat" :data-id="channel.id" :class="{ - 'hide-motd': !this.$root.settings.motd, - 'colored-nicks': this.$root.settings.coloredNicks, - 'show-seconds': this.$root.settings.showSeconds, + 'hide-motd': !$store.state.settings.motd, + 'colored-nicks': $store.state.settings.coloredNicks, + 'show-seconds': $store.state.settings.showSeconds, }" >
!constants.condensedTypes.includes(message.type) ); } // If actions are not condensed, just return raw message list - if (this.$root.settings.statusMessages !== "condensed") { + if (this.$store.state.settings.statusMessages !== "condensed") { return this.channel.messages; } diff --git a/client/components/Windows/Settings.vue b/client/components/Windows/Settings.vue index d54ade6c..129b8258 100644 --- a/client/components/Windows/Settings.vue +++ b/client/components/Windows/Settings.vue @@ -10,7 +10,7 @@