@@ -18,6 +18,8 @@ public sealed partial class CallComposite
18
18
19
19
private ElementReference callContainer ;
20
20
21
+ private CallControlOptions ? lastControlOptions ;
22
+
21
23
/// <summary>
22
24
/// Gets or sets the <see cref="CallAdapter"/> which provides the logic and data of the composite control.
23
25
/// The <see cref="CallComposite"/> can also be controlled using the adapter.
@@ -121,8 +123,68 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
121
123
ScreenShareButton = this . ScreenShareButton ,
122
124
} ;
123
125
124
- await adapter . Module . InvokeVoidAsync ( "initializeControl" , this . callContainer , adapter . Id , options ) ;
126
+ if ( this . ControlOptionsHasBeenChanged ( options ) )
127
+ {
128
+ await adapter . Module . InvokeVoidAsync ( "initializeControl" , this . callContainer , adapter . Id , options ) ;
129
+
130
+ this . lastControlOptions = options ;
131
+ }
132
+ }
133
+ }
134
+
135
+ private bool ControlOptionsHasBeenChanged ( CallControlOptions newOptions )
136
+ {
137
+ if ( this . lastControlOptions is null )
138
+ {
139
+ return true ;
125
140
}
141
+
142
+ if ( this . lastControlOptions . CameraButton != newOptions . CameraButton )
143
+ {
144
+ return true ;
145
+ }
146
+
147
+ if ( this . lastControlOptions . DevicesButton != newOptions . DevicesButton )
148
+ {
149
+ return true ;
150
+ }
151
+
152
+ if ( this . lastControlOptions . EndCallButton != newOptions . EndCallButton )
153
+ {
154
+ return true ;
155
+ }
156
+
157
+ if ( this . lastControlOptions . MicrophoneButton != newOptions . MicrophoneButton )
158
+ {
159
+ return true ;
160
+ }
161
+
162
+ if ( this . lastControlOptions . MoreButton != newOptions . MoreButton )
163
+ {
164
+ return true ;
165
+ }
166
+
167
+ if ( this . lastControlOptions . ParticipantsButton != newOptions . ParticipantsButton )
168
+ {
169
+ return true ;
170
+ }
171
+
172
+ if ( this . lastControlOptions . PeopleButton != newOptions . PeopleButton )
173
+ {
174
+ return true ;
175
+ }
176
+
177
+ if ( this . lastControlOptions . RaiseHandButton != newOptions . RaiseHandButton )
178
+ {
179
+ return true ;
180
+ }
181
+
182
+ if ( this . lastControlOptions . ScreenShareButton != newOptions . ScreenShareButton )
183
+ {
184
+ return true ;
185
+ }
186
+
187
+ return false ;
126
188
}
127
189
}
128
190
}
0 commit comments