A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: fix intro flow
Ammar Ahmed4df9c7d9f770
diff --git a/apps/mobile/app/components/auth/common.js b/apps/mobile/app/components/auth/common.jsindex 10bdbab1d..113e6daac 100644--- a/apps/mobile/app/components/auth/common.js+++ b/apps/mobile/app/components/auth/common.js@@ -29,9 +29,12 @@ export const AuthMode = {};export const initialAuthMode = createRef(0);-export function hideAuth() {+export function hideAuth(context) {eSendEvent(eCloseLoginDialog);- if (initialAuthMode.current === AuthMode.welcomeSignup) {+ if (+ initialAuthMode.current === AuthMode.welcomeSignup ||+ context === "intro"+ ) {Navigation.replace("FluidPanelsView");setTimeout(() => {Navigation.resetRootState();diff --git a/apps/mobile/app/components/auth/header.tsx b/apps/mobile/app/components/auth/header.tsxindex 05187004d..a30f11bce 100644--- a/apps/mobile/app/components/auth/header.tsx+++ b/apps/mobile/app/components/auth/header.tsx@@ -17,16 +17,18 @@ You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/import { useThemeColors } from "@notesnook/theme";+import { useRoute } from "@react-navigation/native";import React from "react";import { Platform, View } from "react-native";import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";import { Button } from "../ui/button";import { IconButton } from "../ui/icon-button";import { hideAuth } from "./common";-export const AuthHeader = (props: { welcome?: boolean }) => {const { colors } = useThemeColors();const insets = useGlobalSafeAreaInsets();+ const route = useRoute();+return (<Viewstyle={{@@ -48,7 +50,7 @@ export const AuthHeader = (props: { welcome?: boolean }) => {<IconButtonname="arrow-left"onPress={() => {- hideAuth();+ hideAuth((route.params as any)?.context);}}color={colors.primary.paragraph}/>diff --git a/apps/mobile/app/components/intro/index.tsx b/apps/mobile/app/components/intro/index.tsxindex a2712c78d..213059351 100644--- a/apps/mobile/app/components/intro/index.tsx+++ b/apps/mobile/app/components/intro/index.tsx@@ -20,11 +20,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.import { strings } from "@notesnook/intl";import { useThemeColors } from "@notesnook/theme";import React from "react";-import { Linking, ScrollView, useWindowDimensions, View } from "react-native";+import { Linking, useWindowDimensions, View } from "react-native";import { SwiperFlatList } from "react-native-swiper-flatlist";import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";import Navigation from "../../services/navigation";-import SettingsService from "../../services/settings";import { AppFontSize } from "../../utils/size";import { DefaultAppStyles } from "../../utils/styles";import { AuthMode } from "../auth/common";@@ -34,7 +33,7 @@ import Paragraph from "../ui/typography/paragraph";const Intro = () => {const { colors } = useThemeColors();- const { width, height } = useWindowDimensions();+ const { width } = useWindowDimensions();const insets = useGlobalSafeAreaInsets();const isTablet = width > 600;@@ -205,7 +204,8 @@ const Intro = () => {// introCompleted: true// });Navigation.push("Auth", {- mode: AuthMode.login+ mode: AuthMode.login,+ context: "intro"});}}/>diff --git a/apps/mobile/app/stores/use-navigation-store.ts b/apps/mobile/app/stores/use-navigation-store.tsindex 0d18c714e..6e9fd618f 100644--- a/apps/mobile/app/stores/use-navigation-store.ts+++ b/apps/mobile/app/stores/use-navigation-store.ts@@ -54,6 +54,7 @@ export type AppLockRouteParams = {export type AuthParams = {mode: number;+ context?: "intro";};export interface RouteParams extends ParamListBase {