Skip to content

Commit

Permalink
Fix boolean value return [Android]
Browse files Browse the repository at this point in the history
#68
Fixes enable/disable debug mode
  • Loading branch information
triniwiz committed Sep 18, 2018
1 parent 8957ac2 commit c8cac5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-socketio",
"version": "3.1.4",
"version": "3.1.5",
"description": "Socket.IO for nativescript",
"main": "socketio",
"typings": "index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/socketio.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class SocketIO extends Common {
} else if (typeof query === 'string') {
opts.query = query;
}
} else if (key === 'debug') {
} else if (key === 'debug' && options[key]) {
co.fitcom.fancylogger.FancyLogger.reset(new co.fitcom.fancylogger.FancyLogger());

java.util.logging.Logger.getLogger(io.socket.client.Socket.class.getName()).setLevel(java.util.logging.Level.FINEST);
Expand Down Expand Up @@ -217,7 +217,7 @@ export function deserialize(data): any {
}

case 'java.lang.Boolean': {
return Boolean(data);
return String(data) === 'true';
}

case 'java.lang.Integer':
Expand Down
2 changes: 1 addition & 1 deletion src/socketio.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class SocketIO extends Common {
Object.assign(connectParams, optionsQuery);

}
} else if (key === 'debug') {
} else if (key === 'debug' && obj[key]) {
opts['log'] = true;
} else {
opts[key] = serialize(obj[key]);
Expand Down

0 comments on commit c8cac5e

Please sign in to comment.