Fix TypeError: u.abort is not a function

The abort method is not always present and the xhr may not be abortable.
This mirrors the 'abort' in promise check later in the file.

Bug: T259652
Change-Id: I7dad89b083d6a0a83ffc59e29af8942cb0eaf640
This commit is contained in:
jdlrobson 2020-09-03 10:10:56 -07:00
parent 85006a8e5e
commit 5dfb0ea04e
3 changed files with 3 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View file

@ -342,7 +342,9 @@ export function referenceClick( title, el, gateway, generateToken ) {
if ( !clickFollowsDwellEvent() ) {
token = generateToken();
} else {
dwellPromise.abort();
if ( 'abort' in dwellPromise ) {
dwellPromise.abort();
}
}
dispatch( timedAction( {