Skip to content

Commit

Permalink
fix(navigation): do not count random failures as navigation cancel (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman authored Feb 19, 2020
1 parent 223685e commit 9f1edad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,10 @@ export class Frame {
let resolve: (error: Error|void) => void;
const promise = new Promise<Error|void>(x => resolve = x);
const watch = (documentId: string, error?: Error) => {
if (documentId !== expectedDocumentId)
return resolve(new Error('Navigation interrupted by another one'));
resolve(error);
if (documentId === expectedDocumentId)
resolve(error);
else if (!error)
resolve(new Error('Navigation interrupted by another one'));
};
const dispose = () => this._documentWatchers.delete(watch);
this._documentWatchers.add(watch);
Expand Down

0 comments on commit 9f1edad

Please sign in to comment.