Skip to content

Commit

Permalink
fix: Socket
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalan7 committed Feb 28, 2022
1 parent d68d990 commit bca8283
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/lib/wapi/functions/check-number-status.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
export async function checkNumberStatus(id, conn = false) {
try {
const err = { error: 404 };
const connection = window.Store.State.Socket.state;
const connection =
window.Store &&
window.Store.State &&
window.Store.State.Socket &&
window.Store.State.Socket.state
? window.Store.State.Socket.state
: undefined;
const checkType = WAPI.sendCheckType(id);
if (!!checkType && checkType.status === 404) {
Object.assign(err, {
Expand Down
8 changes: 7 additions & 1 deletion src/lib/wapi/serializers/serielize-me.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ export const _serializeMeObj = async (obj) => {
return null;
}

const connection = await window.Store.State.Socket.state;
const connection =
window.Store &&
window.Store.State &&
window.Store.State.Socket &&
window.Store.State.Socket.state
? window.Store.State.Socket.state
: undefined;

let PicThumb = undefined;
if (
Expand Down

1 comment on commit bca8283

@jonalan7
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.