[Calling][Bugfix] Dont notify capabilities onstart (#1035)

This commit is contained in:
pavelprystinka 2024-06-26 14:03:38 -07:00 коммит произвёл GitHub
Родитель 5643cfe08b
Коммит c375b23230
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -704,11 +704,12 @@ internal class CallingMiddlewareActionHandlerImpl(
(it.type == ParticipantCapabilityType.MANAGE_LOBBY && !it.isAllowed)
}
store.dispatch(
ToastNotificationAction.ShowNotification(
if (anyLostCapability) ToastNotificationKind.SOME_FEATURES_LOST else ToastNotificationKind.SOME_FEATURES_GAINED
if (anyLostCapability || !store.getCurrentState().localParticipantState.currentCapabilitiesAreDefault)
store.dispatch(
ToastNotificationAction.ShowNotification(
if (anyLostCapability) ToastNotificationKind.SOME_FEATURES_LOST else ToastNotificationKind.SOME_FEATURES_GAINED
)
)
)
}
}
}

Просмотреть файл

@ -10,7 +10,7 @@ import com.azure.android.communication.ui.calling.redux.state.AppReduxState
internal class AppStateReducer(
private val callStateReducer: CallStateReducer,
private val participantStateReducer: ParticipantStateReducer,
private val deviceStateReducer: LocalParticipantStateReducer,
private val localParticipantReducer: LocalParticipantStateReducer,
private val permissionStateReducer: PermissionStateReducer,
private val lifecycleReducer: LifecycleReducer,
private val errorReducer: ErrorReducer,
@ -41,7 +41,7 @@ internal class AppStateReducer(
action
)
appState.localParticipantState = deviceStateReducer.reduce(
appState.localParticipantState = localParticipantReducer.reduce(
state.localParticipantState,
action
)

Просмотреть файл

@ -246,7 +246,8 @@ internal class LocalParticipantStateReducerImpl : LocalParticipantStateReducer {
}
is LocalParticipantAction.SetCapabilities -> {
localUserState.copy(
capabilities = action.capabilities
capabilities = action.capabilities,
currentCapabilitiesAreDefault = false,
)
}
else -> localUserState

Просмотреть файл

@ -53,6 +53,7 @@ internal class AppReduxState(
ParticipantCapabilityType.TURN_VIDEO_ON,
ParticipantCapabilityType.UNMUTE_MICROPHONE
),
currentCapabilitiesAreDefault = true,
)
override var permissionState: PermissionState =

Просмотреть файл

@ -83,4 +83,5 @@ internal data class LocalUserState(
val localParticipantRole: ParticipantRole?,
val audioVideoMode: CallCompositeAudioVideoMode = CallCompositeAudioVideoMode.AUDIO_AND_VIDEO,
val capabilities: Set<ParticipantCapabilityType> = emptySet(),
val currentCapabilitiesAreDefault: Boolean = true,
)