MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / onPopState

Method onPopState

core/src/components/router/router.tsx:92–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90
91 @Listen('popstate', { target: 'window' })
92 protected async onPopState() {
93 const direction = this.historyDirection();
94 let segments = this.getSegments();
95
96 const canProceed = await this.runGuards(segments);
97 if (canProceed !== true) {
98 if (typeof canProceed === 'object') {
99 segments = parsePath(canProceed.redirect).segments;
100 } else {
101 return false;
102 }
103 }
104 const result = await this.writeNavStateRoot(segments, direction);
105 if (result) {
106 this.maybeScrollToFragment();
107 }
108
109 return result;
110 }
111
112 @Listen('ionBackButton', { target: 'document' })
113 protected onBackButton(ev: BackButtonEvent) {

Callers

nothing calls this directly

Calls 6

historyDirectionMethod · 0.95
getSegmentsMethod · 0.95
runGuardsMethod · 0.95
writeNavStateRootMethod · 0.95
maybeScrollToFragmentMethod · 0.95
parsePathFunction · 0.90

Tested by

no test coverage detected