Permalink
Browse files

Fix InteractionManager promise issue with some OSS setups

Reviewed By: yungsters

Differential Revision: D3860551

fbshipit-source-id: 731ba758e28ce24f12ca80f7be0f962e6929ee2c
  • Loading branch information...
1 parent 25e048b commit 3b5e4cc59331b49d2ab8cf2fed74dabd2251fe9c @sahrens sahrens committed with Facebook Github Bot 3 Sep 15, 2016
Showing with 7 additions and 1 deletion.
  1. +7 −1 Libraries/Interaction/InteractionManager.js
@@ -99,7 +99,13 @@ var InteractionManager = {
});
return {
then: promise.then.bind(promise),
- done: promise.done.bind(promise),
+ done: (...args) => {
+ if (promise.done) {
+ promise.done(...args);
@leeight
leeight Sep 16, 2016 Contributor

Missing return?

@sahrens
sahrens Sep 16, 2016 Contributor

Ah jeeze, good catch...

+ } else {
+ console.warn('Tried to call done when not supported by current Promise implementation.');
@satya164
satya164 Sep 16, 2016 Contributor

Isn't this going to always warn in OSS. Will be annoying IMO.

@sahrens
sahrens via email Sep 17, 2016 Contributor
+ }
+ },
cancel: function() {
_taskQueue.cancelTasks(tasks);
},

0 comments on commit 3b5e4cc

Please sign in to comment.