Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.0
-
None
Description
The fix for CB-683 has broken previous behavior of the 'deviceready' event. Prior to CB-683, registering an event listener for the 'deviceready' event after the event had already fired would result in the specified handler immediately being fired.
The difference is due to channel.subscribe instead of channel.subscribeOnce being used. A simple fix is to add back the invocation of subscribeOnce if the event is 'deviceready':
if (typeof documentEventHandlers[e] != 'undefined') { if (evt === 'deviceready') { documentEventHandlers[e].subscribeOnce(handler); } else { documentEventHandlers[e].subscribe(handler); } } else {