47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
// Metro module 10797 (f10798).
|
|
import * as _CallsUtils from "../../voice_calls/native/CallsUtils";
|
|
import { handleToggleSelfMute, showSuppressedAlert, showServerMuteAlert, showServerDeafenAlert } from "../../voice_calls/native/CallsUtils";
|
|
let c7257_3;
|
|
const NOOP = function NOOP() {};
|
|
c7257_3 = {
|
|
SERVER_MUTE: 0,
|
|
0: "SERVER_MUTE",
|
|
SUPPRESS: 1,
|
|
1: "SUPPRESS",
|
|
SELF_MUTE: 2,
|
|
2: "SELF_MUTE",
|
|
NONE: 3,
|
|
3: "NONE"
|
|
};
|
|
export { c7257_3 as DominantMuteState };
|
|
export function createMuteHandler(a0, r4 = false) {
|
|
let NONE = c7257_3.NONE;
|
|
if (a0.selfMute) {
|
|
NONE = c7257_3.SELF_MUTE;
|
|
}
|
|
let onPress = r4 ? NOOP : handleToggleSelfMute;
|
|
if (a0.suppress) {
|
|
onPress = showSuppressedAlert;
|
|
NONE = c7257_3.SUPPRESS;
|
|
}
|
|
if (a0.mute) {
|
|
onPress = showServerMuteAlert;
|
|
NONE = c7257_3.SERVER_MUTE;
|
|
}
|
|
return {
|
|
mute: a0.selfMute || a0.mute || a0.suppress,
|
|
onPress,
|
|
dominantMuteState: NONE
|
|
};
|
|
}
|
|
export function createDeafHandler(a0) {
|
|
let handleToggleSelfDeaf = _CallsUtils.handleToggleSelfDeaf;
|
|
if (a0.deaf) {
|
|
handleToggleSelfDeaf = showServerDeafenAlert;
|
|
}
|
|
return {
|
|
deaf: a0.selfDeaf || a0.deaf,
|
|
onPress: handleToggleSelfDeaf
|
|
};
|
|
}
|