Sfoglia il codice sorgente

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

factor2
Horatiu Muresan 2 anni fa
parent
commit
fed74afffe
Nessun account collegato all'indirizzo email del committer

+ 5
- 2
react/features/base/ui/components/web/Checkbox.tsx Vedi File

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

+ 13
- 7
react/features/settings/components/web/SoundsTab.tsx Vedi File

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

+ 1
- 0
react/features/settings/functions.any.ts Vedi File

241
     const moderatorMutedSoundsReactions = state['features/base/conference'].startReactionsMuted ?? false;
241
     const moderatorMutedSoundsReactions = state['features/base/conference'].startReactionsMuted ?? false;
242
 
242
 
243
     return {
243
     return {
244
+        disabledSounds: state['features/base/config'].disabledSounds || [],
244
         soundsIncomingMessage,
245
         soundsIncomingMessage,
245
         soundsParticipantJoined,
246
         soundsParticipantJoined,
246
         soundsParticipantKnocking,
247
         soundsParticipantKnocking,

Loading…
Annulla
Salva