about summary refs log tree commit diff
path: root/src/view/shell/mobile/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/shell/mobile/index.tsx')
-rw-r--r--src/view/shell/mobile/index.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/view/shell/mobile/index.tsx b/src/view/shell/mobile/index.tsx
index cad681bd6..b4b98e35e 100644
--- a/src/view/shell/mobile/index.tsx
+++ b/src/view/shell/mobile/index.tsx
@@ -268,7 +268,7 @@ export const MobileShell: React.FC = observer(() => {
         <GestureDetector gesture={swipeGesture}>
           <ScreenContainer style={styles.screenContainer}>
             {screenRenderDesc.screens.map(
-              ({Com, params, key, current, previous}) => {
+              ({Com, navIdx, params, key, current, previous}) => {
                 return (
                   <Screen
                     key={key}
@@ -293,6 +293,7 @@ export const MobileShell: React.FC = observer(() => {
                       ]}>
                       <Com
                         params={params}
+                        navIdx={navIdx}
                         visible={current}
                         scrollElRef={current ? scrollElRef : undefined}
                       />
@@ -361,6 +362,7 @@ export const MobileShell: React.FC = observer(() => {
  */
 type ScreenRenderDesc = MatchResult & {
   key: string
+  navIdx: [number, number]
   current: boolean
   previous: boolean
   isNewTab: boolean
@@ -388,6 +390,7 @@ function constructScreenRenderDesc(nav: NavigationModel): {
       hasNewTab = hasNewTab || tab.isNewTab
       return Object.assign(matchRes, {
         key: `t${tab.id}-s${screen.index}`,
+        navIdx: [tab.id, screen.id],
         current: isCurrent,
         previous: isPrevious,
         isNewTab: tab.isNewTab,