Skip to content

Commit d2cc5eb

Browse files
committed
refactor: rename onIncomingCall, onAcceptedCall
To be in line with the command names. Also `onIncomingCall` -> `acceptCall` is just better (IMO).
1 parent f3269f8 commit d2cc5eb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/calls.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class CallsManager {
104104
this.onStateChanged(this.state);
105105
};
106106

107-
const onIncomingCall = async (payload: string) => {
107+
const acceptCall = async (payload: string) => {
108108
await this.setIceServersPromise;
109109
const gatheredEnoughIceP = gatheredEnoughIce(this.peerConnection);
110110

@@ -130,7 +130,7 @@ export class CallsManager {
130130
logSDP("Answering incoming call with answer:", answer);
131131
window.calls.acceptCall(answer);
132132
};
133-
const onAcceptedCall = (payload: string) => {
133+
const onAnswer = (payload: string) => {
134134
const answerObject = {
135135
type: "answer",
136136
sdp: payload,
@@ -152,11 +152,11 @@ export class CallsManager {
152152
} else if (hash.startsWith("acceptCall=")) {
153153
const offer = window.atob(hash.substring(11));
154154
logSDP("Incoming call with offer:", offer);
155-
await onIncomingCall(offer);
155+
await acceptCall(offer);
156156
} else if (hash.startsWith("onAnswer=")) {
157157
const answer = window.atob(hash.substring(9));
158158
logSDP("Outgoing call was accepted with answer:", answer);
159-
onAcceptedCall(answer);
159+
onAnswer(answer);
160160
} else {
161161
console.log("unexpected URL hash: ", hash);
162162
}

0 commit comments

Comments
 (0)