Bläddra i källkod

fix(sound-settings) Disable checkbox for disabled sounds (#12976)

factor2
Horatiu Muresan 2 år sedan
förälder
incheckning
fed74afffe
Inget konto är kopplat till bidragsgivarens mejladress

+ 5
- 2
react/features/base/ui/components/web/Checkbox.tsx Visa fil

@@ -53,6 +53,10 @@ const useStyles = makeStyles()(theme => {
53 53
             }
54 54
         },
55 55
 
56
+        disabled: {
57
+            cursor: 'not-allowed'
58
+        },
59
+
56 60
         activeArea: {
57 61
             display: 'grid',
58 62
             placeContent: 'center',
@@ -73,7 +77,6 @@ const useStyles = makeStyles()(theme => {
73 77
                 height: '18px',
74 78
                 border: `2px solid ${theme.palette.icon03}`,
75 79
                 borderRadius: '3px',
76
-                cursor: 'pointer',
77 80
 
78 81
                 display: 'grid',
79 82
                 placeContent: 'center',
@@ -154,7 +157,7 @@ const Checkbox = ({
154 157
 
155 158
     return (
156 159
         <div className = { cx(styles.formControl, isMobile && 'is-mobile', className) }>
157
-            <label className = { cx(styles.activeArea, isMobile && 'is-mobile') }>
160
+            <label className = { cx(styles.activeArea, isMobile && 'is-mobile', disabled && styles.disabled) }>
158 161
                 <input
159 162
                     checked = { checked }
160 163
                     disabled = { disabled }

+ 13
- 7
react/features/settings/components/web/SoundsTab.tsx Visa fil

@@ -98,6 +98,7 @@ class SoundsTab extends AbstractDialogTab<Props> {
98 98
      */
99 99
     render() {
100 100
         const {
101
+            disabledSounds,
101 102
             soundsIncomingMessage,
102 103
             soundsParticipantJoined,
103 104
             soundsParticipantKnocking,
@@ -117,40 +118,45 @@ class SoundsTab extends AbstractDialogTab<Props> {
117 118
                     {t('settings.playSounds')}
118 119
                 </h2>
119 120
                 {enableReactions && <Checkbox
120
-                    checked = { soundsReactions }
121
+                    checked = { soundsReactions && !disabledSounds.includes('REACTION_SOUND') }
121 122
                     className = 'settings-checkbox'
122
-                    disabled = { moderatorMutedSoundsReactions }
123
+                    disabled = { moderatorMutedSoundsReactions || disabledSounds.includes('REACTION_SOUND') }
123 124
                     label = { t('settings.reactions') }
124 125
                     name = 'soundsReactions'
125 126
                     onChange = { this._onChange } />
126 127
                 }
127 128
                 <Checkbox
128
-                    checked = { soundsIncomingMessage }
129
+                    checked = { soundsIncomingMessage && !disabledSounds.includes('INCOMING_MSG_SOUND') }
129 130
                     className = 'settings-checkbox'
131
+                    disabled = { disabledSounds.includes('INCOMING_MSG_SOUND') }
130 132
                     label = { t('settings.incomingMessage') }
131 133
                     name = 'soundsIncomingMessage'
132 134
                     onChange = { this._onChange } />
133 135
                 <Checkbox
134
-                    checked = { soundsParticipantJoined }
136
+                    checked = { soundsParticipantJoined && !disabledSounds.includes('PARTICIPANT_JOINED_SOUND') }
135 137
                     className = 'settings-checkbox'
138
+                    disabled = { disabledSounds.includes('PARTICIPANT_JOINED_SOUND') }
136 139
                     label = { t('settings.participantJoined') }
137 140
                     name = 'soundsParticipantJoined'
138 141
                     onChange = { this._onChange } />
139 142
                 <Checkbox
140
-                    checked = { soundsParticipantLeft }
143
+                    checked = { soundsParticipantLeft && !disabledSounds.includes('PARTICIPANT_LEFT_SOUND') }
141 144
                     className = 'settings-checkbox'
145
+                    disabled = { disabledSounds.includes('PARTICIPANT_LEFT_SOUND') }
142 146
                     label = { t('settings.participantLeft') }
143 147
                     name = 'soundsParticipantLeft'
144 148
                     onChange = { this._onChange } />
145 149
                 <Checkbox
146
-                    checked = { soundsTalkWhileMuted }
150
+                    checked = { soundsTalkWhileMuted && !disabledSounds.includes('TALK_WHILE_MUTED_SOUND') }
147 151
                     className = 'settings-checkbox'
152
+                    disabled = { disabledSounds.includes('TALK_WHILE_MUTED_SOUND') }
148 153
                     label = { t('settings.talkWhileMuted') }
149 154
                     name = 'soundsTalkWhileMuted'
150 155
                     onChange = { this._onChange } />
151 156
                 <Checkbox
152
-                    checked = { soundsParticipantKnocking }
157
+                    checked = { soundsParticipantKnocking && !disabledSounds.includes('KNOCKING_PARTICIPANT_SOUND') }
153 158
                     className = 'settings-checkbox'
159
+                    disabled = { disabledSounds.includes('KNOCKING_PARTICIPANT_SOUND') }
154 160
                     label = { t('settings.participantKnocking') }
155 161
                     name = 'soundsParticipantKnocking'
156 162
                     onChange = { this._onChange } />

+ 1
- 0
react/features/settings/functions.any.ts Visa fil

@@ -241,6 +241,7 @@ export function getSoundsTabProps(stateful: IStateful) {
241 241
     const moderatorMutedSoundsReactions = state['features/base/conference'].startReactionsMuted ?? false;
242 242
 
243 243
     return {
244
+        disabledSounds: state['features/base/config'].disabledSounds || [],
244 245
         soundsIncomingMessage,
245 246
         soundsParticipantJoined,
246 247
         soundsParticipantKnocking,

Laddar…
Avbryt
Spara