1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.registerIgnoredTransitionHook = void 0;
|
4 | var trace_1 = require("../common/trace");
|
5 | var rejectFactory_1 = require("../transition/rejectFactory");
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | function ignoredHook(trans) {
|
15 | var ignoredReason = trans._ignoredReason();
|
16 | if (!ignoredReason)
|
17 | return;
|
18 | trace_1.trace.traceTransitionIgnored(trans);
|
19 | var pending = trans.router.globals.transition;
|
20 |
|
21 |
|
22 |
|
23 | if (ignoredReason === 'SameAsCurrent' && pending) {
|
24 | pending.abort();
|
25 | }
|
26 | return rejectFactory_1.Rejection.ignored().toPromise();
|
27 | }
|
28 | exports.registerIgnoredTransitionHook = function (transitionService) {
|
29 | return transitionService.onBefore({}, ignoredHook, { priority: -9999 });
|
30 | };
|
31 |
|
\ | No newline at end of file |