mobile: fix selection in sidebar on app launch

This commit is contained in:
Ammar Ahmed
2025-02-27 16:06:51 +05:00
committed by Abdullah Atta
parent 4e897dde47
commit aba79c11d3
2 changed files with 3 additions and 12 deletions

View File

@@ -69,7 +69,6 @@ export const SelectionHeader = React.memo(
const allSelected =
items?.placeholders?.length === selectedItemsList.length;
const focusedRouteId = useNavigationStore((state) => state.focusedRouteId);
console.log(focusedRouteId, "focusedRouteId");
useEffect(() => {
if (selectionMode) {
fluidTabsRef.current?.lock();

View File

@@ -28,7 +28,7 @@ import useNavigationStore, {
} from "../stores/use-navigation-store";
import { useSelectionStore } from "../stores/use-selection-store";
import { useSettingStore } from "../stores/use-setting-store";
import { fluidTabsRef, rootNavigatorRef } from "../utils/global-refs";
import { rootNavigatorRef } from "../utils/global-refs";
const RootStack = createNativeStackNavigator();
const AppStack = createNativeStackNavigator();
@@ -50,7 +50,8 @@ const AppNavigation = React.memo(
React.useEffect(() => {
setTimeout(() => {
useNavigationStore.getState().update(homepage as keyof RouteParams);
}, 1000);
useNavigationStore.getState().setFocusedRouteId(homepage);
}, 300);
}, [homepage]);
return (
@@ -171,15 +172,6 @@ export const RootNavigation = () => {
screenOptions={{
headerShown: false
}}
screenListeners={{
focus: (props) => {
if (props.target?.startsWith("FluidPanelsView")) {
fluidTabsRef.current?.unlock();
} else {
fluidTabsRef.current?.lock();
}
}
}}
initialRouteName={introCompleted ? "FluidPanelsView" : "Welcome"}
>
<RootStack.Screen