mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
mobile: fix selection in sidebar on app launch
This commit is contained in:
committed by
Abdullah Atta
parent
4e897dde47
commit
aba79c11d3
@@ -69,7 +69,6 @@ export const SelectionHeader = React.memo(
|
|||||||
const allSelected =
|
const allSelected =
|
||||||
items?.placeholders?.length === selectedItemsList.length;
|
items?.placeholders?.length === selectedItemsList.length;
|
||||||
const focusedRouteId = useNavigationStore((state) => state.focusedRouteId);
|
const focusedRouteId = useNavigationStore((state) => state.focusedRouteId);
|
||||||
console.log(focusedRouteId, "focusedRouteId");
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectionMode) {
|
if (selectionMode) {
|
||||||
fluidTabsRef.current?.lock();
|
fluidTabsRef.current?.lock();
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import useNavigationStore, {
|
|||||||
} from "../stores/use-navigation-store";
|
} from "../stores/use-navigation-store";
|
||||||
import { useSelectionStore } from "../stores/use-selection-store";
|
import { useSelectionStore } from "../stores/use-selection-store";
|
||||||
import { useSettingStore } from "../stores/use-setting-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 RootStack = createNativeStackNavigator();
|
||||||
const AppStack = createNativeStackNavigator();
|
const AppStack = createNativeStackNavigator();
|
||||||
@@ -50,7 +50,8 @@ const AppNavigation = React.memo(
|
|||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
useNavigationStore.getState().update(homepage as keyof RouteParams);
|
useNavigationStore.getState().update(homepage as keyof RouteParams);
|
||||||
}, 1000);
|
useNavigationStore.getState().setFocusedRouteId(homepage);
|
||||||
|
}, 300);
|
||||||
}, [homepage]);
|
}, [homepage]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -171,15 +172,6 @@ export const RootNavigation = () => {
|
|||||||
screenOptions={{
|
screenOptions={{
|
||||||
headerShown: false
|
headerShown: false
|
||||||
}}
|
}}
|
||||||
screenListeners={{
|
|
||||||
focus: (props) => {
|
|
||||||
if (props.target?.startsWith("FluidPanelsView")) {
|
|
||||||
fluidTabsRef.current?.unlock();
|
|
||||||
} else {
|
|
||||||
fluidTabsRef.current?.lock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
initialRouteName={introCompleted ? "FluidPanelsView" : "Welcome"}
|
initialRouteName={introCompleted ? "FluidPanelsView" : "Welcome"}
|
||||||
>
|
>
|
||||||
<RootStack.Screen
|
<RootStack.Screen
|
||||||
|
|||||||
Reference in New Issue
Block a user