Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 01f0c66

Browse files
toger5robintown
andauthored
Hotfix fix: waitForEvent does resolve immediatly. (#12201)
* New room header - add chat button during call - close lobby button in lobby - join button if session exists - allow to toggle call <-> timeline during call with call button Compound style for join button in call notify toast. Signed-off-by: Timo K <[email protected]> * dont show start call, join button in video rooms. Signed-off-by: Timo K <[email protected]> * Make active call check based on participant count Not based on available call object Signed-off-by: Timo K <[email protected]> * fix room header tests Signed-off-by: Timo K <[email protected]> * fix room header tests Signed-off-by: Timo K <[email protected]> * remove chat button test for displaying. Chat button display logic is now part of the RoomHeader. Signed-off-by: Timo K <[email protected]> * remove duplicate notification Tread icon Signed-off-by: Timo K <[email protected]> * remove obsolete jest snapshot Signed-off-by: Timo K <[email protected]> * Update src/components/views/rooms/RoomHeader.tsx Co-authored-by: Robin <[email protected]> * update isECWidget logic Signed-off-by: Timo K <[email protected]> * remove dead code Signed-off-by: Timo K <[email protected]> * refactor call options Add menu to choose if there are multiple options Signed-off-by: Timo K <[email protected]> * join ec when clicking join button (dont start jitsi) Use icon buttons don't show call icon when join button is visible Signed-off-by: Timo K <[email protected]> * refactor isViewingCall Signed-off-by: Timo K <[email protected]> * fix room header tests Signed-off-by: Timo K <[email protected]> * fix header snapshot Signed-off-by: Timo K <[email protected]> * sonar proposals Signed-off-by: Timo K <[email protected]> * fix event shiftKey may be undefined Signed-off-by: Timo K <[email protected]> * more lobby time before timeout only await sticky promise on becoming sticky. Signed-off-by: Timo K <[email protected]> * don't allow starting new calls if there is an ongoing other call. Signed-off-by: Timo K <[email protected]> * review Signed-off-by: Timo K <[email protected]> * fix translation typo Signed-off-by: Timo K <[email protected]> * missing await in case customTimeout=false Signed-off-by: Timo K <[email protected]> --------- Signed-off-by: Timo K <[email protected]> Co-authored-by: Robin <[email protected]>
1 parent c6dddf8 commit 01f0c66

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/models/Call.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,18 @@ const waitForEvent = async (
7070
let listener: (...args: any[]) => void;
7171
const wait = new Promise<void>((resolve) => {
7272
listener = (...args) => {
73-
if (pred(...args)) {
74-
resolve();
75-
if (customTimeout === false) {
76-
emitter.off(event, listener!);
77-
}
78-
}
73+
if (pred(...args)) resolve();
7974
};
8075
emitter.on(event, listener);
8176
});
8277

8378
if (customTimeout !== false) {
8479
const timedOut = (await timeout(wait, false, customTimeout ?? TIMEOUT_MS)) === false;
85-
emitter.off(event, listener!);
8680
if (timedOut) throw new Error("Timed out");
81+
} else {
82+
await wait;
8783
}
84+
emitter.off(event, listener!);
8885
};
8986

9087
export enum ConnectionState {

0 commit comments

Comments
 (0)