Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix clear trash option is disabled on login

Ammar Ahmed7c95faad2106
diff --git a/apps/mobile/app/components/sheets/menu-item-properties/index.tsx b/apps/mobile/app/components/sheets/menu-item-properties/index.tsx
index 2b3180da0..1e8c28a35 100644
--- a/apps/mobile/app/components/sheets/menu-item-properties/index.tsx
+++ b/apps/mobile/app/components/sheets/menu-item-properties/index.tsx
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useAreFeaturesAvailable } from "@notesnook/common";
import { strings } from "@notesnook/intl";
import { useThemeColors } from "@notesnook/theme";
-import React from "react";
+import React, { useEffect } from "react";
import { View } from "react-native";
import {
eSendEvent,
@@ -44,14 +44,22 @@ import PaywallSheet from "../paywall";
import { presentDialog } from "../../dialog/functions";
import { db } from "../../../common/database";
import { useTrashStore } from "../../../stores/use-trash-store";
+import { useSettingStore } from "../../../stores/use-setting-store";
export const MenuItemProperties = ({ item }: { item: SideMenuItem }) => {
const { colors } = useThemeColors();
const featuresAvailable = useAreFeaturesAvailable([
"customHomepage",
"customizableSidebar"
]);
+ const isAppLoading = useSettingStore((state) => state.isAppLoading);
const trash = useTrashStore((state) => state.items);
+ useEffect(() => {
+ if (!isAppLoading) {
+ useTrashStore.getState().refresh();
+ }
+ }, [isAppLoading]);
+
return !featuresAvailable ? null : (
<View
style={{