Hang up call when screen is locked

This commit is contained in:
Josh Perez
2022-01-24 15:32:09 -05:00
committed by GitHub
parent 884bfc0594
commit 44bfb77635
4 changed files with 37 additions and 0 deletions

View File

@@ -751,6 +751,31 @@ function hangUp(payload: HangUpType): HangUpActionType {
};
}
function hangUpActiveCall(): ThunkAction<
void,
RootStateType,
unknown,
HangUpActionType
> {
return (dispatch, getState) => {
const state = getState();
const activeCall = getActiveCall(state.calling);
if (!activeCall) {
return;
}
const { conversationId } = activeCall;
dispatch({
type: HANG_UP,
payload: {
conversationId,
},
});
};
}
function keyChanged(
payload: KeyChangedType
): ThunkAction<void, RootStateType, unknown, KeyChangedActionType> {
@@ -1219,6 +1244,7 @@ export const actions = {
getPresentingSources,
groupCallStateChange,
hangUp,
hangUpActiveCall,
keyChangeOk,
keyChanged,
openSystemPreferencesAction,