Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
feat: recieves messages sended by http method
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossantos74 committed Jun 2, 2024
1 parent b16ad68 commit a845cd1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@superviz/socket-client": "1.4.0",
"@superviz/socket-client": "1.5.1",
"ably": "^1.2.45",
"bowser": "^2.11.0",
"bowser-jr": "^1.0.6",
Expand Down
2 changes: 1 addition & 1 deletion src/components/realtime/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class Channel extends Observable {
this.logger.log('message received', event);
this.publishEventToClient(event.data.name, {
data: event.data.payload,
participantId: event.presence.id,
participantId: event?.presence?.id || null,
name: event.data.name,
timestamp: event.timestamp,
} as RealtimeMessage);
Expand Down
2 changes: 1 addition & 1 deletion src/components/realtime/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type RealtimeData = {
export type RealtimeMessage = {
name: string;
connectionId: string;
participantId: string;
participantId: string | null;
data: unknown;
timestamp: number;
};
2 changes: 1 addition & 1 deletion src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const init = async (apiKey: string, options: SuperVizSdkOptions): Promise<Launch
ApiService.createOrUpdateParticipant({
name: participant.name,
participantId: participant.id,
avatar: participant.avatar?.imageUrl,
avatar: participant.avatar?.imageUrl,
});

return LauncherFacade(options);
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2481,10 +2481,10 @@
resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553"
integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==

"@superviz/socket-client@1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@superviz/socket-client/-/socket-client-1.4.0.tgz#374326131dd4a89f2d8f71e8be1305ed55311921"
integrity sha512-Ue66/5dxhGaPxqiFE3KWjusfp2FCBmT8vPJfq8FMD/ZCR6ac/tqnKqLrMtpz3oA6/51CQW9tfoSuqaXC+hrKWw==
"@superviz/socket-client@1.5.1":
version "1.5.1"
resolved "https://registry.yarnpkg.com/@superviz/socket-client/-/socket-client-1.5.1.tgz#db1d14f6fbd29ac5e8cf3241dcf8b80cc42e814e"
integrity sha512-T+9vbYsKDPuHHrtKWZHLqHJTQ9uL4rQm8xm9OqqIr2E+c6kXkSIZsW40BKK6r45BTX4FT2i8rIS31BxptG5PRQ==
dependencies:
"@reactivex/rxjs" "^6.6.7"
debug "^4.3.4"
Expand Down

0 comments on commit a845cd1

Please sign in to comment.