Skip to content

Commit

Permalink
fix: 单历史模式下的历史状态管理
Browse files Browse the repository at this point in the history
  • Loading branch information
‘YAG’ committed Nov 28, 2022
1 parent d9929f7 commit c3358cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lath",
"version": "0.10.9",
"version": "0.10.13",
"description": "Seamless connection of pages.",
"keywords": [
"lath",
Expand Down
4 changes: 2 additions & 2 deletions src/Segue/History.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ class SegueHistory extends SegueBase {
}
public requestRegisterHistory(id = '', title = '', search = ''): void {
if (this.applet.viewType === 'portal') return
// No state changes are made to those returned from history
if (this.fromHistoryBack || this.fromHistoryForward) return
if (this.options.oneHistory) {
if (this.prevHistoryStep === -1) {
return this.replaceState(id, title, search)
}
} else if (this.prevHistoryStep === -1) {
return this.replaceState(id, title, search)
}
// No state changes are made to those returned from history
if (this.fromHistoryBack || this.fromHistoryForward) return
this.pushState(id, title, search)
}
public async toHistory(state?: PopState): Promise<void> {
Expand Down

0 comments on commit c3358cd

Please sign in to comment.