From cd2ca94c3de45ca7c7be552aea87be67600464a5 Mon Sep 17 00:00:00 2001
From: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
Date: Fri, 7 Apr 2023 01:10:52 +0500
Subject: [PATCH] mobile: Fix crash when leaving note after search (#2289)
---
apps/mobile/app/hooks/use-actions.js | 2 +-
apps/mobile/app/screens/settings/home.tsx | 90 +++++++++----------
.../app/screens/settings/section-group.tsx | 4 +-
.../settings/trash-interval-selector.jsx | 2 +-
apps/mobile/app/services/navigation.ts | 8 +-
apps/mobile/app/services/search.js | 2 +-
apps/mobile/e2e/tests/note.e2e.js | 22 ++---
apps/mobile/e2e/tests/search.e2e.js | 8 +-
8 files changed, 73 insertions(+), 65 deletions(-)
diff --git a/apps/mobile/app/hooks/use-actions.js b/apps/mobile/app/hooks/use-actions.js
index 30f9d4801..aeec775ea 100644
--- a/apps/mobile/app/hooks/use-actions.js
+++ b/apps/mobile/app/hooks/use-actions.js
@@ -623,7 +623,7 @@ export const useActions = ({ close = () => null, item }) => {
id: "pin-to-notifications",
title:
notifPinned !== null
- ? "Unpin from Notifications"
+ ? "Unpin from notifications"
: "Pin to notifications",
icon: "message-badge-outline",
on: notifPinned !== null,
diff --git a/apps/mobile/app/screens/settings/home.tsx b/apps/mobile/app/screens/settings/home.tsx
index 2e8f32f4c..55f0c8e19 100644
--- a/apps/mobile/app/screens/settings/home.tsx
+++ b/apps/mobile/app/screens/settings/home.tsx
@@ -20,7 +20,7 @@ along with this program. If not, see .
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import React, { useEffect, useState } from "react";
import { View } from "react-native";
-import Animated, { FadeInDown, FadeOutDown } from "react-native-reanimated";
+import Animated, { FadeInDown } from "react-native-reanimated";
import DelayLayout from "../../components/delay-layout";
import BaseDialog from "../../components/dialog/base-dialog";
import { ProgressBarComponent } from "../../components/ui/svg/lazy";
@@ -75,57 +75,55 @@ const Home = ({
return (
-
- {loading && (
- //@ts-ignore // Migrate to typescript required.
-
+ {loading && (
+ //@ts-ignore // Migrate to typescript required.
+
+
+
+ Logging out
+
+
+ Please wait while we log out and clear app data.
+
-
- Logging out
-
-
- Please wait while we log out and clear app data.
-
-
-
-
+
-
- )}
+
+
+ )}
- }
- renderItem={renderItem}
- />
-
+ }
+ renderItem={renderItem}
+ />
);
};
diff --git a/apps/mobile/app/screens/settings/section-group.tsx b/apps/mobile/app/screens/settings/section-group.tsx
index dcbae2bf9..606e3d01b 100644
--- a/apps/mobile/app/screens/settings/section-group.tsx
+++ b/apps/mobile/app/screens/settings/section-group.tsx
@@ -42,12 +42,12 @@ export const SectionGroup = ({ item }: { item: SettingSection }) => {
color={colors.accent}
size={SIZE.xs}
>
- {item.name.toUpperCase()}
+ {(item.name as string).toUpperCase()}
) : null}
{item.sections?.map((item) => (
-
+
))}
);
diff --git a/apps/mobile/app/screens/settings/trash-interval-selector.jsx b/apps/mobile/app/screens/settings/trash-interval-selector.jsx
index 383f9fcbe..6ab611707 100644
--- a/apps/mobile/app/screens/settings/trash-interval-selector.jsx
+++ b/apps/mobile/app/screens/settings/trash-interval-selector.jsx
@@ -87,7 +87,7 @@ export const TrashIntervalSelector = () => {
>
{[-1, 7, 30, 365].map((item) => (