Don't leak deferreds out of functions

Always try to return a promise.

Bug: T170807
Change-Id: I4a48b6e40a5398a743e39589b5c2fcac4482a814
This commit is contained in:
joakin 2018-02-15 15:01:36 +01:00
parent 95b880aa29
commit 2df22ef2b2
3 changed files with 2 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View file

@ -205,7 +205,7 @@ export function linkDwell( title, el, event, gateway, generateToken ) {
dispatch( action );
if ( !isNewInteraction() ) {
return $.Deferred().resolve();
return $.Deferred().resolve().promise();
}
return wait( FETCH_START_DELAY )
@ -232,7 +232,7 @@ export function abandon() {
var token = getState().preview.activeToken;
if ( !token ) {
return $.Deferred().resolve();
return $.Deferred().resolve().promise();
}
dispatch( timedAction( {