From 65502404b6d8c7a7c00299d3a842823a5b6879a2 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Tue, 14 Feb 2023 10:00:58 +0100 Subject: fix code style for computed labels Signed-off-by: Maksim Sukharev --- .../CallView/shared/LocalMediaControls.vue | 60 ++++++++++------------ 1 file changed, 28 insertions(+), 32 deletions(-) (limited to 'src/components/CallView') diff --git a/src/components/CallView/shared/LocalMediaControls.vue b/src/components/CallView/shared/LocalMediaControls.vue index 33ccccad4..d3ae048b2 100644 --- a/src/components/CallView/shared/LocalMediaControls.vue +++ b/src/components/CallView/shared/LocalMediaControls.vue @@ -280,10 +280,9 @@ export default { }, toggleVirtualBackgroundButtonLabel() { - if (!this.isVirtualBackgroundEnabled) { - return t('spreed', 'Blur background') - } - return t('spreed', 'Disable background blur') + return this.isVirtualBackgroundEnabled + ? t('spreed', 'Disable background blur') + : t('spreed', 'Blur background') }, conversation() { @@ -334,17 +333,13 @@ export default { let content = '' if (this.model.attributes.audioEnabled) { - if (this.disableKeyboardShortcuts) { - content = t('spreed', 'Mute audio') - } else { - content = t('spreed', 'Mute audio (M)') - } + content = this.disableKeyboardShortcuts + ? t('spreed', 'Mute audio') + : t('spreed', 'Mute audio (M)') } else { - if (this.disableKeyboardShortcuts) { - content = t('spreed', 'Unmute audio') - } else { - content = t('spreed', 'Unmute audio (M)') - } + content = this.disableKeyboardShortcuts + ? t('spreed', 'Unmute audio') + : t('spreed', 'Unmute audio (M)') } return { @@ -357,7 +352,10 @@ export default { if (!this.model.attributes.audioAvailable) { return t('spreed', 'No audio') } - return this.model.attributes.audioEnabled ? t('spreed', 'Mute audio') : t('spreed', 'Unmute audio') + + return this.model.attributes.audioEnabled + ? t('spreed', 'Mute audio') + : t('spreed', 'Unmute audio') }, videoButtonClass() { @@ -387,26 +385,20 @@ export default { } if (this.model.attributes.videoEnabled) { - if (this.disableKeyboardShortcuts) { - return t('spreed', 'Disable video') - } - - return t('spreed', 'Disable video (V)') + return this.disableKeyboardShortcuts + ? t('spreed', 'Disable video') + : t('spreed', 'Disable video (V)') } if (!this.model.getWebRtc() || !this.model.getWebRtc().connection || this.model.getWebRtc().connection.getSendVideoIfAvailable()) { - if (this.disableKeyboardShortcuts) { - return t('spreed', 'Enable video') - } - - return t('spreed', 'Enable video (V)') - } - - if (this.disableKeyboardShortcuts) { - return t('spreed', 'Enable video - Your connection will be briefly interrupted when enabling the video for the first time') + return this.disableKeyboardShortcuts + ? t('spreed', 'Enable video') + : t('spreed', 'Enable video (V)') } - return t('spreed', 'Enable video (V) - Your connection will be briefly interrupted when enabling the video for the first time') + return this.disableKeyboardShortcuts + ? t('spreed', 'Enable video - Your connection will be briefly interrupted when enabling the video for the first time') + : t('spreed', 'Enable video (V) - Your connection will be briefly interrupted when enabling the video for the first time') }, videoButtonAriaLabel() { @@ -445,7 +437,9 @@ export default { return t('spreed', 'No screensharing') } - return this.model.attributes.localScreen ? t('spreed', 'Screensharing options') : t('spreed', 'Enable screensharing') + return this.model.attributes.localScreen + ? t('spreed', 'Screensharing options') + : t('spreed', 'Enable screensharing') }, screenSharingButtonAriaLabel() { @@ -453,7 +447,9 @@ export default { return '' } - return this.model.attributes.localScreen ? t('spreed', 'Screensharing options') : t('spreed', 'Enable screensharing') + return this.model.attributes.localScreen + ? t('spreed', 'Screensharing options') + : t('spreed', 'Enable screensharing') }, container() { -- cgit v1.2.3 From efe312e29f4109add75c74cb7befc3b208a1a725 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Tue, 14 Feb 2023 10:18:39 +0100 Subject: move label for lower hand button to computed Signed-off-by: Maksim Sukharev --- src/components/CallView/shared/LocalMediaControls.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/components/CallView') diff --git a/src/components/CallView/shared/LocalMediaControls.vue b/src/components/CallView/shared/LocalMediaControls.vue index d3ae048b2..4d9ac897c 100644 --- a/src/components/CallView/shared/LocalMediaControls.vue +++ b/src/components/CallView/shared/LocalMediaControls.vue @@ -151,12 +151,12 @@