acspushmod icon indicating copy to clipboard operation
acspushmod copied to clipboard

Android bug?

Open icecandy opened this issue 8 years ago • 4 comments

This module is used in our project, but I haven't been using it myself so not so familiar with it. I did just notice a dodgy line in the Android options: Line 84 CloudPush.singleCallback = androidOptions.singleCallback || true; If androidOptions.singleCallback is false, CloudPush.singleCallback will be assigned the value true which is not the intended value I believe. Have to be careful when checking for the existence of object values that are of type Boolean (same applies to the other options assignments).

icecandy avatar May 22 '17 11:05 icecandy

Yeah you're right using Underscore.js awesomeness would be good:

CloudPush.singleCallback = _.has(androidOptions, "singleCallback") ? androidOptions.singleCallback : true;

or

_.defaults(androidOptions, { singleCallback: true });

clemblanco avatar May 22 '17 12:05 clemblanco

Yes I like the _.has method because it "does what it says on the tin" :)

icecandy avatar May 22 '17 12:05 icecandy

Have a look at 1.0.4.

clemblanco avatar May 22 '17 13:05 clemblanco

Great

icecandy avatar May 22 '17 14:05 icecandy