Skip to content

Commit 3b5e4cc

Browse files
sahrensFacebook Github Bot 3
authored andcommitted
Fix InteractionManager promise issue with some OSS setups
Reviewed By: yungsters Differential Revision: D3860551 fbshipit-source-id: 731ba758e28ce24f12ca80f7be0f962e6929ee2c
1 parent 25e048b commit 3b5e4cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Libraries/Interaction/InteractionManager.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ var InteractionManager = {
9999
});
100100
return {
101101
then: promise.then.bind(promise),
102-
done: promise.done.bind(promise),
102+
done: (...args) => {
103+
if (promise.done) {
104+
promise.done(...args);
105+
} else {
106+
console.warn('Tried to call done when not supported by current Promise implementation.');
107+
}
108+
},
103109
cancel: function() {
104110
_taskQueue.cancelTasks(tasks);
105111
},

0 commit comments

Comments
 (0)