This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,48 @@
// Metro module 12853 (f12854).
import AuthenticationStore from "../../../../stores/AuthenticationStore";
import CallStore from "../../../../stores/CallStore";
import VoiceStateStore from "../../../../stores/VoiceStateStore";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { intl, t } from "../../../../intl/index.native";
import { CallStates } from "../CallStateHooks";
import { LegacyText } from "../../../../design/void/native";
export default function OngoingCallStatusLabel(props) {
let r31;
const { style, channel: channel2, voiceState } = props;
let useAllAloneText = props.useAllAloneText;
if (useAllAloneText === void 0) {
useAllAloneText = true;
}
let id;
const channel = channel2;
if (useAllAloneText === void 0) {
useAllAloneText = true;
}
L15: {
id = void 0;
id = AuthenticationStore.getId();
const stateFromStores = useStateFromStores([VoiceStateStore, CallStore], () => {
if (channel == null) {
return false;
}
const r13 = Object.values(VoiceStateStore.getVoiceStatesForChannel(channel.id));
const call = CallStore.getCall(channel.id);
const r2 = call != null && call.ringing.length > 0;
return (r2 ? !r2 : r13.length === 1) && r13[0].userId === id;
}, [id, channel]);
r31 = intl.string(t["1zFMqU"]);
if (CallStates.DISCONNECTING !== voiceState && CallStates.CONNECTED !== voiceState) {
if (CallStates.RINGING === voiceState) {
r31 = intl.string(t.Xuzre8);
break L15;
}
if (CallStates.DISCONNECTED !== voiceState) {
break L15;
}
r31 = intl.string(t["w//7ET"]);
} else {
r31 = stateFromStores && useAllAloneText ? intl.string(t.xNeSms) : intl.string(t["NGg/fm"]);
}
}
return <LegacyText style={style}>{r31}</LegacyText>;
};
@@ -0,0 +1,10 @@
// Metro module 12854 (f12855).
import CallStore from "../../../../stores/CallStore";
import { useStateFromStores } from "../../../../_bundle/Module589";
import SnowflakeUtils from "../../../../utils/SnowflakeUtils";
import Timer from "./Timer";
export default function OnGoingCallTimer(props) {
const { style, channelId } = props;
const stateFromStores = useStateFromStores([CallStore], () => CallStore.getCall(channelId)?.messageId, [channelId]);
return <Timer style={style} timestamp={stateFromStores != null ? SnowflakeUtils.extractTimestamp(stateFromStores) : 0} />;
};
@@ -0,0 +1,157 @@
// Metro module 12855 (f12856).
import { PureComponent } from "react";
import Module12 from "../../../../_bundle/Module12";
import { LegacyText } from "../../../../design/void/native";
class Timer extends PureComponent {
static defaultProps = {
hideMinutes: false,
hideHours: false
};
_incrementSecond = () => {
const state = this.state;
const { seconds, minutes, hours } = state;
let seconds2 = seconds + 1;
let hours2 = hours;
let minutes2 = minutes;
if (seconds2 >= 60) {
let r12 = minutes + 1;
let r13 = hours;
if (r12 >= 60) {
r13 = hours + 1;
r12 = 0;
}
seconds2 = 0;
hours2 = r13;
minutes2 = r12;
}
this.setState({
seconds: seconds2,
minutes: minutes2,
hours: hours2
});
};
_decrementSecond = () => {
let r15, r16;
const state = this.state;
const { seconds, minutes, hours } = state;
let r0 = seconds - 1;
let hours2 = hours;
let minutes2 = minutes;
let seconds2 = r0;
if (seconds2 < 1) {
if (minutes >= 1) {
r16 = minutes - 1;
r0 = 59;
r15 = hours;
} else {
const r5 = minutes < 1 && hours >= 1;
r15 = hours;
r16 = minutes;
if (r5) {
r15 = hours - 1;
r16 = 59;
r0 = 59;
}
}
hours2 = r15;
minutes2 = r16;
seconds2 = r0;
}
if (seconds2 <= 0) {
clearInterval(this._timerId);
this._timerId = null;
const onComplete = this.props.onComplete;
if (onComplete != null) {
onComplete();
}
} else {
this.setState({
seconds: seconds2,
minutes: minutes2,
hours: hours2
});
}
};
constructor(a0) {
super(a0);
const { seconds, minutes, hours, timestamp } = a0;
let hours2 = hours;
let minutes2 = minutes;
let seconds2 = seconds;
if (timestamp != null) {
hours2 = hours;
minutes2 = minutes;
seconds2 = seconds;
if (timestamp > 0) {
const r1 = Math.max(0, Date.now() - timestamp) / 1000;
const r35 = Math;
const r38 = r1 % 86400;
hours2 = r35.floor(r38 / 3600);
const r40 = Math;
const r42 = r38 % 3600;
minutes2 = r40.floor(r42 / 60);
seconds2 = Math.floor(r42 % 60);
}
}
if (seconds2 == null) {
seconds2 = 0;
}
if (minutes2 == null) {
minutes2 = 0;
}
if (hours2 == null) {
hours2 = 0;
}
this.state = {
seconds: seconds2,
minutes: minutes2,
hours: hours2
};
}
componentDidMount() {
const countdown = this.props.countdown;
const r6 = setInterval;
if (countdown) {
this._timerId = r6(this._decrementSecond, 1000);
} else {
this._timerId = r6(this._incrementSecond, 1000);
}
}
componentWillUnmount() {
clearInterval(this._timerId);
this._timerId = null;
}
render() {
let r8, r23, r28, r41;
const props = this.props;
const { style, hideHours, hideMinutes } = props;
const state = this.state;
const { seconds, minutes, hours } = state;
if (hideHours) {
r8 = "";
if (hours !== 0) {
r23 = Module12.padStart(String(hours), 2, "0");
r8 = `${r23}:`;
}
} else {
r23 = Module12.padStart(String(hours), 2, "0");
r8 = `${r23}:`;
}
if (hideMinutes) {
r28 = "";
if (minutes !== 0) {
r41 = Module12.padStart(String(minutes), 2, "0");
r28 = `${r41}:`;
}
} else {
r41 = Module12.padStart(String(minutes), 2, "0");
r28 = `${r41}:`;
}
return <LegacyText style={style} accessibilityRole="timer">
{r8}
{r28}
{r8.length > 0 ? Module12.padStart(String(seconds), 2, "0") : r28.length > 0 ? Module12.padStart(String(seconds), 2, "0") : seconds}
</LegacyText>;
}
}
export default Timer;