Turn home button into a 'go back to start of nav history'
This commit is contained in:
parent
9ff78bbc43
commit
d608d67bfe
2 changed files with 7 additions and 1 deletions
|
@ -107,6 +107,12 @@ export class NavigationTabModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goBackToZero() {
|
||||||
|
if (this.canGoBack) {
|
||||||
|
this.index = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
goForward() {
|
goForward() {
|
||||||
if (this.canGoForward) {
|
if (this.canGoForward) {
|
||||||
this.index++
|
this.index++
|
||||||
|
|
|
@ -134,7 +134,7 @@ export const MobileShell: React.FC = observer(() => {
|
||||||
if (store.nav.tab.current.url === '/') {
|
if (store.nav.tab.current.url === '/') {
|
||||||
scrollElRef.current?.scrollToOffset({offset: 0})
|
scrollElRef.current?.scrollToOffset({offset: 0})
|
||||||
} else {
|
} else {
|
||||||
store.nav.navigate('/')
|
store.nav.tab.goBackToZero()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onPressMenu = () => setMainMenuActive(true)
|
const onPressMenu = () => setMainMenuActive(true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue