Skip to content

Commit 9f1edad

Browse files
authored
fix(navigation): do not count random failures as navigation cancel (#1055)
1 parent 223685e commit 9f1edad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/frames.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,10 @@ export class Frame {
428428
let resolve: (error: Error|void) => void;
429429
const promise = new Promise<Error|void>(x => resolve = x);
430430
const watch = (documentId: string, error?: Error) => {
431-
if (documentId !== expectedDocumentId)
432-
return resolve(new Error('Navigation interrupted by another one'));
433-
resolve(error);
431+
if (documentId === expectedDocumentId)
432+
resolve(error);
433+
else if (!error)
434+
resolve(new Error('Navigation interrupted by another one'));
434435
};
435436
const dispose = () => this._documentWatchers.delete(watch);
436437
this._documentWatchers.add(watch);

0 commit comments

Comments
 (0)