Skip to content

Commit

Permalink
🔨 Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Remy committed Jul 23, 2021
1 parent ca873ea commit ba034f6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,16 @@ module.exports = class Client extends EventEmitter {
}

_onSocketClose() {
this.emit('disconnect')
this.emit('disconnect');
this._retry();
}

// eslint-disable-next-line no-unused-vars
_onSocketError(error) {
// ignore, the close handler takes care of retry
}

// eslint-disable-next-line no-unused-vars
_onParserError(error) {
this._retry();
}
Expand Down
4 changes: 2 additions & 2 deletions src/gcm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const { toBase64 } = require('../utils/base64');

// Hack to fix PHONE_REGISTRATION_ERROR #17 when bundled with webpack
// https://github.com/dcodeIO/protobuf.js#browserify-integration
protobuf.util.Long = Long
protobuf.configure()
protobuf.util.Long = Long;
protobuf.configure();

const serverKey = toBase64(Buffer.from(fcmKey));

Expand Down
4 changes: 2 additions & 2 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ module.exports = class Parser extends EventEmitter {
// Messages with no content are valid; just use the default protobuf for
// that tag.
if (this._messageSize === 0) {
this.emit('message', {tag: this._messageTag, object: {}});
this.emit('message', { tag : this._messageTag, object : {} });
this._getNextMessage();
return;
}
Expand All @@ -230,7 +230,7 @@ module.exports = class Parser extends EventEmitter {
bytes : Buffer,
});

this.emit('message', {tag: this._messageTag, object: object});
this.emit('message', { tag : this._messageTag, object : object });

if (this._messageTag === kLoginResponseTag) {
if (this._handshakeComplete) {
Expand Down
5 changes: 4 additions & 1 deletion src/register/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const registerFCM = require('../fcm');

module.exports = register;

async function register(senderId, { bundleId } = { bundleId : 'receiver.push.com' }) {
async function register(
senderId,
{ bundleId } = { bundleId : 'receiver.push.com' }
) {
// Should be unique by app - One GCM registration/token by app/appId
const appId = `wp:${bundleId}#${uuidv4()}`;
const subscription = await registerGCM(appId);
Expand Down

0 comments on commit ba034f6

Please sign in to comment.