diff --git a/apps/mobile/app/common/filesystem/io.js b/apps/mobile/app/common/filesystem/io.js index e51600452..de2086a2c 100644 --- a/apps/mobile/app/common/filesystem/io.js +++ b/apps/mobile/app/common/filesystem/io.js @@ -153,7 +153,10 @@ export async function migrateFilesFromCache() { await createCacheDir(); const migratedFilesPath = cacheDir + "/.migrated_1"; const migrated = await RNFetchBlob.fs.exists(migratedFilesPath); - if (migrated) return; + if (migrated) { + console.log("Files migrated already"); + return; + } let files = await RNFetchBlob.fs.ls(cacheDir); console.log("Files to migrate:", files.join(",")); diff --git a/apps/mobile/app/components/list/card.js b/apps/mobile/app/components/list/card.js index 446893243..72904213c 100644 --- a/apps/mobile/app/components/list/card.js +++ b/apps/mobile/app/components/list/card.js @@ -93,7 +93,7 @@ export const Card = ({ color, warning }) => { . */ +import { useThemeColors } from "@notesnook/theme"; import qclone from "qclone"; import React, { createContext, @@ -26,7 +27,7 @@ import React, { useRef, useState } from "react"; -import { RefreshControl, View } from "react-native"; +import { RefreshControl, useWindowDimensions, View } from "react-native"; import ActionSheet, { ActionSheetRef, FlatList @@ -45,7 +46,6 @@ import { import useNavigationStore, { NotebookScreenParams } from "../../../stores/use-navigation-store"; -import { useThemeColors } from "@notesnook/theme"; import { eOnNewTopicAdded, eOnTopicSheetUpdate, @@ -54,18 +54,17 @@ import { import { normalize, SIZE } from "../../../utils/size"; import { GroupHeader, NotebookType, TopicType } from "../../../utils/types"; +import { getTotalNotes } from "@notesnook/common"; import { groupArray } from "@notesnook/core/dist/utils/grouping"; import Config from "react-native-config"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import { notesnook } from "../../../../e2e/test.ids"; import { MMKV } from "../../../common/database/mmkv"; import { openEditor } from "../../../screens/notes/common"; -import { getTotalNotes } from "@notesnook/common"; +import { useSelectionStore } from "../../../stores/use-selection-store"; import { deleteItems } from "../../../utils/functions"; -import { presentDialog } from "../../dialog/functions"; import { Properties } from "../../properties"; import Sort from "../sort"; -import { useSelectionStore } from "../../../stores/use-selection-store"; type ConfigItem = { id: string; type: string }; class TopicSheetConfig { @@ -108,7 +107,8 @@ export const TopicsSheet = () => { ) : [] ); - + const currentItem = useRef(); + const { fontScale } = useWindowDimensions(); const [groupOptions, setGroupOptions] = useState( db.settings?.getGroupOptions("topics") ); @@ -206,6 +206,11 @@ export const TopicsSheet = () => { if (canShow) { setTimeout(() => { const id = isTopic ? currentScreen?.notebookId : currentScreen?.id; + if (currentItem.current !== id) { + setSelection([]); + setEnabled(false); + } + currentItem.id = id; const notebook = db.notebooks?.notebook(id as string)?.data; const snapPoint = isTopic ? 0 @@ -226,6 +231,8 @@ export const TopicsSheet = () => { } }, 300); } else { + setSelection([]); + setEnabled(false); ref.current?.hide(); } }, [ @@ -329,7 +336,9 @@ export const TopicsSheet = () => { {enabled ? ( { //@ts-ignore @@ -365,8 +374,8 @@ export const TopicsSheet = () => { color={colors.primary.icon} size={22} customStyle={{ - width: 40, - height: 40 + width: 40 * fontScale, + height: 40 * fontScale }} /> { color={colors.primary.icon} size={22} customStyle={{ - width: 40, - height: 40 + width: 40 * fontScale, + height: 40 * fontScale }} /> @@ -395,8 +404,8 @@ export const TopicsSheet = () => { color={colors.primary.icon} size={22} customStyle={{ - width: 40, - height: 40 + width: 40 * fontScale, + height: 40 * fontScale }} /> @@ -470,6 +479,7 @@ const TopicItem = ({ selection.selection.findIndex((selected) => selected.id === item.id) > -1; const isFocused = screen.id === item.id; const notesCount = getTotalNotes(item); + const { fontScale } = useWindowDimensions(); return ( { diff --git a/apps/mobile/app/stores/use-selection-store.ts b/apps/mobile/app/stores/use-selection-store.ts index e14cae42a..f904b8e60 100644 --- a/apps/mobile/app/stores/use-selection-store.ts +++ b/apps/mobile/app/stores/use-selection-store.ts @@ -56,7 +56,7 @@ export const useSelectionStore = create((set, get) => ({ set({ selectedItemsList: selectedItems, - selectionMode: get().selectionMode + selectionMode: selectedItems.length === 0 ? false : get().selectionMode }); }, clearSelection: () => { diff --git a/apps/mobile/native/ios/Podfile.lock b/apps/mobile/native/ios/Podfile.lock index dde9801be..fc8aea1e8 100644 --- a/apps/mobile/native/ios/Podfile.lock +++ b/apps/mobile/native/ios/Podfile.lock @@ -347,7 +347,7 @@ PODS: - ReactCommon/turbomodule/core - react-native-share-extension (2.5.6): - React - - react-native-sodium (1.5.2): + - react-native-sodium (1.5.4): - React - react-native-webview (11.26.1): - React-Core @@ -882,7 +882,7 @@ SPEC CHECKSUMS: react-native-pdf: 33c622cbdf776a649929e8b9d1ce2d313347c4fa react-native-safe-area-context: 36cc67648134e89465663b8172336a19eeda493d react-native-share-extension: df66a2ee48a62277d79898375e2142bde0782063 - react-native-sodium: 7d2bbb9ca840dc58d63f661b2ff733a38170fec5 + react-native-sodium: 955bb0dc3ea05f8ea06d5e96cb89d1be7b5d7681 react-native-webview: 9f111dfbcfc826084d6c507f569e5e03342ee1c1 React-NativeModulesApple: 1d81d927ef1a67a3545a01e14c2e98500bf9b199 React-perflogger: 684a11499a0589cc42135d6d5cc04d0e4e0e261a