| 231 | } |
| 232 | |
| 233 | private historyDirection() { |
| 234 | const win = window; |
| 235 | |
| 236 | if (win.history.state === null) { |
| 237 | this.state++; |
| 238 | win.history.replaceState(this.state, win.document.title, win.document.location?.href); |
| 239 | } |
| 240 | |
| 241 | const state = win.history.state; |
| 242 | const lastState = this.lastState; |
| 243 | this.lastState = state; |
| 244 | |
| 245 | if (state > lastState || (state >= lastState && lastState > 0)) { |
| 246 | return ROUTER_INTENT_FORWARD; |
| 247 | } |
| 248 | if (state < lastState) { |
| 249 | return ROUTER_INTENT_BACK; |
| 250 | } |
| 251 | return ROUTER_INTENT_NONE; |
| 252 | } |
| 253 | |
| 254 | private async writeNavStateRoot( |
| 255 | segments: string[] | null, |