Skip to content

Commit

Permalink
fix: fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammeds1992 committed Jan 18, 2024
1 parent f93c645 commit 6a91107
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/restapi/src/lib/pushstream/PushStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class PushStream extends EventEmitter {
private options: PushStreamInitializeProps;
private chatInstance: Chat;
private listen: STREAM[];
private disconnected: boolean;

constructor(
account: string,
Expand All @@ -42,7 +43,7 @@ export class PushStream extends EventEmitter {
this.raw = options.raw ?? false;
this.options = options;
this.listen = _listen;

this.disconnected = false;
this.chatInstance = new Chat(
this.account,
this.options.env as ENV,
Expand Down Expand Up @@ -105,7 +106,7 @@ export class PushStream extends EventEmitter {
!this.listen ||
this.listen.length === 0 ||
this.listen.includes(STREAM.NOTIF) ||
this.listen.includes(STREAM.NOTIF_OPS) ||
this.listen.includes(STREAM.NOTIF_OPS) ||
this.listen.includes(STREAM.VIDEO);

let isChatSocketConnected = false;
Expand Down Expand Up @@ -325,7 +326,9 @@ export class PushStream extends EventEmitter {
// Video Notification
const modifiedData = DataModifier.mapToVideoEvent(
data,
this.account === data.sender ? MessageOrigin.Self : MessageOrigin.Other,
this.account === data.sender
? MessageOrigin.Self
: MessageOrigin.Other,
this.raw
);

Expand Down Expand Up @@ -385,7 +388,10 @@ export class PushStream extends EventEmitter {
}

public connected(): boolean {
return (this.pushNotificationSocket && this.pushNotificationSocket.connected) || (this.pushChatSocket && this.pushChatSocket.connected);
return (
(this.pushNotificationSocket && this.pushNotificationSocket.connected) ||
(this.pushChatSocket && this.pushChatSocket.connected)
);
}

public async disconnect(): Promise<void> {
Expand Down

0 comments on commit 6a91107

Please sign in to comment.