diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2024-11-14 10:33:03 +0100 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2024-11-14 14:07:58 +0100 |
commit | 334ad4928a2fd19a1d68a14e41b26f4a20337d0b (patch) | |
tree | 7a1c54f819b9609dc71ff87f8b046b3df2b922c5 | |
parent | 821377bf1c37dbdba792dd5017f8ed86300b9905 (diff) |
fix(matterbridge): refactor computed properties
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
-rw-r--r-- | src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue b/src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue index ebe8fb0224..76d5416b87 100644 --- a/src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue +++ b/src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue @@ -23,7 +23,7 @@ <NcSelect label="displayName" :aria-label-combobox="t('spreed', 'Messaging systems')" :placeholder="newPartPlaceholder" - :options="formatedTypes" + :options="options" @input="clickAddPart"> <template #option="option"> <img class="icon-multiselect-service" @@ -137,26 +137,39 @@ export default { computed: { token() { - const token = this.$store.getters.getToken() - this.getBridge(token) - this.relaunchStateLoop(token) - return token + return this.$store.getters.getToken() }, - formatedTypes() { + + options() { return Object.entries(this.matterbridgeTypes).map(([type, value]) => ({ type, displayName: value.name, iconUrl: value.iconUrl, })) }, + processStateText() { - return this.processRunning === null - ? t('spreed', 'unknown state') - : this.processRunning - ? t('spreed', 'running') - : this.enabled - ? t('spreed', 'not running, check Matterbridge log') - : t('spreed', 'not running') + if (this.processRunning === null) { + return t('spreed', 'unknown state') + } + + if (this.processRunning) { + return t('spreed', 'running') + } else { + return this.enabled + ? t('spreed', 'not running, check Matterbridge log') + : t('spreed', 'not running') + } + }, + }, + + watch: { + token: { + immediate: true, + handler(token) { + this.getBridge(token) + this.relaunchStateLoop(token) + }, }, }, |