Tentatively rename URL parameter to waitForCallPickup

This commit is contained in:
Robin
2025-09-03 16:52:40 +02:00
parent b8acdc3cec
commit 1428df8567
3 changed files with 14 additions and 14 deletions

View File

@@ -226,7 +226,7 @@ export interface UrlConfiguration {
* - play a sound that indicates that it is awaiting an answer * - play a sound that indicates that it is awaiting an answer
* - auto-dismiss the call widget once the notification lifetime expires on the receivers side. * - auto-dismiss the call widget once the notification lifetime expires on the receivers side.
*/ */
shouldWaitForCallPickup: boolean; waitForCallPickup: boolean;
} }
// If you need to add a new flag to this interface, prefer a name that describes // If you need to add a new flag to this interface, prefer a name that describes
@@ -358,7 +358,7 @@ export const getUrlParams = (
returnToLobby: false, returnToLobby: false,
sendNotificationType: "notification" as RTCNotificationType, sendNotificationType: "notification" as RTCNotificationType,
autoLeaveWhenOthersLeft: false, autoLeaveWhenOthersLeft: false,
shouldWaitForCallPickup: false, waitForCallPickup: false,
}; };
switch (intent) { switch (intent) {
case UserIntent.StartNewCall: case UserIntent.StartNewCall:
@@ -378,7 +378,7 @@ export const getUrlParams = (
...inAppDefault, ...inAppDefault,
skipLobby: true, skipLobby: true,
autoLeaveWhenOthersLeft: true, autoLeaveWhenOthersLeft: true,
shouldWaitForCallPickup: true, waitForCallPickup: true,
}; };
break; break;
case UserIntent.JoinExistingCallDM: case UserIntent.JoinExistingCallDM:
@@ -404,7 +404,7 @@ export const getUrlParams = (
returnToLobby: false, returnToLobby: false,
sendNotificationType: undefined, sendNotificationType: undefined,
autoLeaveWhenOthersLeft: false, autoLeaveWhenOthersLeft: false,
shouldWaitForCallPickup: false, waitForCallPickup: false,
}; };
} }
@@ -456,7 +456,7 @@ export const getUrlParams = (
"ring", "ring",
"notification", "notification",
]), ]),
shouldWaitForCallPickup: parser.getFlag("shouldWaitForCallPickup"), waitForCallPickup: parser.getFlag("waitForCallPickup"),
autoLeaveWhenOthersLeft: parser.getFlag("autoLeave"), autoLeaveWhenOthersLeft: parser.getFlag("autoLeave"),
}; };

View File

@@ -1193,7 +1193,7 @@ test("autoLeave$ emits when autoLeaveWhenOthersLeft option is enabled and all ot
}); });
}); });
describe("shouldWaitForCallPickup$", () => { describe("waitForCallPickup$", () => {
test("unknown -> ringing -> timeout when notified and nobody joins", () => { test("unknown -> ringing -> timeout when notified and nobody joins", () => {
withTestScheduler(({ schedule, expectObservable }) => { withTestScheduler(({ schedule, expectObservable }) => {
// No one ever joins (only local user) // No one ever joins (only local user)
@@ -1220,7 +1220,7 @@ describe("shouldWaitForCallPickup$", () => {
}); });
}, },
{ {
shouldWaitForCallPickup: true, waitForCallPickup: true,
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT }, encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
}, },
); );
@@ -1264,7 +1264,7 @@ describe("shouldWaitForCallPickup$", () => {
}); });
}, },
{ {
shouldWaitForCallPickup: true, waitForCallPickup: true,
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT }, encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
}, },
); );
@@ -1305,7 +1305,7 @@ describe("shouldWaitForCallPickup$", () => {
}); });
}, },
{ {
shouldWaitForCallPickup: true, waitForCallPickup: true,
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT }, encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
}, },
); );
@@ -1336,14 +1336,14 @@ describe("shouldWaitForCallPickup$", () => {
}); });
}, },
{ {
shouldWaitForCallPickup: true, waitForCallPickup: true,
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT }, encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
}, },
); );
}); });
}); });
test("stays null when shouldWaitForCallPickup=false", () => { test("stays null when waitForCallPickup=false", () => {
withTestScheduler(({ behavior, schedule, expectObservable }) => { withTestScheduler(({ behavior, schedule, expectObservable }) => {
withCallViewModel( withCallViewModel(
{ {
@@ -1375,7 +1375,7 @@ describe("shouldWaitForCallPickup$", () => {
}); });
}, },
{ {
shouldWaitForCallPickup: false, waitForCallPickup: false,
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT }, encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
}, },
); );

View File

@@ -120,7 +120,7 @@ export interface CallViewModelOptions {
* If the call is started in a way where we want it to behave like a telephone usecase * If the call is started in a way where we want it to behave like a telephone usecase
* If we sent a notification event, we want the ui to show a ringing state * If we sent a notification event, we want the ui to show a ringing state
*/ */
shouldWaitForCallPickup?: boolean; waitForCallPickup?: boolean;
} }
// How long we wait after a focus switch before showing the real participant // How long we wait after a focus switch before showing the real participant
@@ -916,7 +916,7 @@ export class CallViewModel extends ViewModel {
* - "success": Someone else joined. The call is in a normal state. No audiovisual feedback. * - "success": Someone else joined. The call is in a normal state. No audiovisual feedback.
* - null: EC is configured to never show any waiting for answer state. * - null: EC is configured to never show any waiting for answer state.
*/ */
public readonly callPickupState$ = this.options.shouldWaitForCallPickup public readonly callPickupState$ = this.options.waitForCallPickup
? this.scope.behavior<"unknown" | "ringing" | "timeout" | "success">( ? this.scope.behavior<"unknown" | "ringing" | "timeout" | "success">(
concat( concat(
concat( concat(