Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
atomrc committed Jan 16, 2024
1 parent cad2f25 commit 0d4ccbd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
9 changes: 4 additions & 5 deletions src/script/calling/CallingRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1579,11 +1579,10 @@ export class CallingRepository {
}

private updateParticipantAudioState(call: Call, members: QualifiedWcallMember[]): void {
members.forEach(
member =>
call
.getParticipant(member.userId, member.clientid)
?.isAudioEstablished(member.aestab === AUDIO_STATE.ESTABLISHED),
members.forEach(member =>
call
.getParticipant(member.userId, member.clientid)
?.isAudioEstablished(member.aestab === AUDIO_STATE.ESTABLISHED),
);
}

Expand Down
21 changes: 9 additions & 12 deletions src/script/event/EventRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,29 @@ describe('EventRepository', () => {

it('should not save but distribute "user.*" events', () => {
return testFactory
.event_repository!['handleEvent'](
{event: {type: USER_EVENT.UPDATE, user: {id: ''}}},
EventSource.NOTIFICATION_STREAM,
)
.event_repository![
'handleEvent'
]({event: {type: USER_EVENT.UPDATE, user: {id: ''}}}, EventSource.NOTIFICATION_STREAM)
.then(() => {
expect(testFactory.event_repository!['distributeEvent']).toHaveBeenCalled();
});
});

it('should not save but distribute "call.*" events', () => {
return testFactory
.event_repository!['handleEvent'](
{event: {type: ClientEvent.CALL.E_CALL} as any},
EventSource.NOTIFICATION_STREAM,
)
.event_repository![
'handleEvent'
]({event: {type: ClientEvent.CALL.E_CALL} as any}, EventSource.NOTIFICATION_STREAM)
.then(() => {
expect(testFactory.event_repository!['distributeEvent']).toHaveBeenCalled();
});
});

it('should not save but distribute "conversation.create" events', () => {
return testFactory
.event_repository!['handleEvent'](
{event: {type: CONVERSATION_EVENT.CREATE} as any},
EventSource.NOTIFICATION_STREAM,
)
.event_repository![
'handleEvent'
]({event: {type: CONVERSATION_EVENT.CREATE} as any}, EventSource.NOTIFICATION_STREAM)
.then(() => {
expect(testFactory.event_repository!['distributeEvent']).toHaveBeenCalled();
});
Expand Down
9 changes: 4 additions & 5 deletions src/script/media/MediaDevicesHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,10 @@ export class MediaDevicesHandler {
return window.desktopCapturer.getSources(options);
}
// Electron <= 4
return new Promise(
(resolve, reject) =>
window.desktopCapturer?.getSources(options, (error, screenSources) =>
error ? reject(error) : resolve(screenSources),
),
return new Promise((resolve, reject) =>
window.desktopCapturer?.getSources(options, (error, screenSources) =>
error ? reject(error) : resolve(screenSources),
),
);
};

Expand Down

0 comments on commit 0d4ccbd

Please sign in to comment.