Skip to content

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

mobile: fix imports

Ammar Ahmed33c7eb5a74b5
diff --git a/apps/mobile/app/common/filesystem/download-attachment.tsx b/apps/mobile/app/common/filesystem/download-attachment.tsx
index 4a6d4bfd8..0ac25b3c3 100644
--- a/apps/mobile/app/common/filesystem/download-attachment.tsx
+++ b/apps/mobile/app/common/filesystem/download-attachment.tsx
@@ -24,12 +24,12 @@ import { Platform } from "react-native";
import RNFetchBlob from "react-native-blob-util";
import * as ScopedStorage from "react-native-scoped-storage";
import { subscribe, zip } from "react-native-zip-archive";
+import filesystem from ".";
import { ShareComponent } from "../../components/sheets/export-notes/share";
import { presentSheet, ToastManager } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { IOS_APPGROUPID } from "../../utils/constants";
import { DatabaseLogger, db } from "../database";
-import filesystem from "../filesystem";
import { createCacheDir, exists } from "./io";
import { cacheDir, copyFileAsync, releasePermissions } from "./utils";
diff --git a/apps/mobile/app/screens/reminders/index.tsx b/apps/mobile/app/screens/reminders/index.tsx
index 40862d98b..e4498cf99 100644
--- a/apps/mobile/app/screens/reminders/index.tsx
+++ b/apps/mobile/app/screens/reminders/index.tsx
@@ -91,7 +91,6 @@ export const Reminders = ({
/>
<FloatingButton
- title={strings.setReminder()}
onPress={() => {
ReminderSheet.present();
}}
diff --git a/apps/mobile/app/screens/settings/2fa.tsx b/apps/mobile/app/screens/settings/2fa.tsx
index a7302dfb5..a8276e672 100644
--- a/apps/mobile/app/screens/settings/2fa.tsx
+++ b/apps/mobile/app/screens/settings/2fa.tsx
@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+import { sanitizeFilename } from "@notesnook/common";
+import { strings } from "@notesnook/intl";
+import { useThemeColors, VariantsWithStaticColors } from "@notesnook/theme";
import Clipboard from "@react-native-clipboard/clipboard";
import React, {
Dispatch,
@@ -26,11 +29,11 @@ import React, {
useState
} from "react";
import { ActivityIndicator, Linking, Platform, View } from "react-native";
+import RNFetchBlob from "react-native-blob-util";
import { FlatList } from "react-native-gesture-handler";
import * as ScopedStorage from "react-native-scoped-storage";
-import RNFetchBlob from "react-native-blob-util";
import { db } from "../../common/database";
-import Storage from "../../common/database/storage";
+import filesystem from "../../common/filesystem";
import DialogHeader from "../../components/dialog/dialog-header";
import { Button } from "../../components/ui/button";
import { IconButton } from "../../components/ui/icon-button";
@@ -46,13 +49,10 @@ import {
presentSheet,
ToastManager
} from "../../services/event-manager";
-import { useThemeColors, VariantsWithStaticColors } from "@notesnook/theme";
import { useUserStore } from "../../stores/use-user-store";
import { eCloseSheet } from "../../utils/events";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
-import { sanitizeFilename } from "@notesnook/common";
-import { strings } from "@notesnook/intl";
const mfaMethods: MFAMethod[] = [
{
id: "app",
@@ -525,7 +525,7 @@ export const MFARecoveryCodes = ({
if (!file) return;
path = file.uri;
} else {
- path = await Storage.checkAndCreateDir("/");
+ path = await filesystem.checkAndCreateDir("/");
await RNFetchBlob.fs.writeFile(
path + fileName,
codeString,
diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsx
index 199062639..7df6dc6af 100644
--- a/apps/mobile/app/screens/settings/settings-data.tsx
+++ b/apps/mobile/app/screens/settings/settings-data.tsx
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { formatBytes } from "@notesnook/common";
+import { User } from "@notesnook/core";
import { strings } from "@notesnook/intl";
import notifee from "@notifee/react-native";
import Clipboard from "@react-native-clipboard/clipboard";
@@ -74,7 +75,6 @@ import { useDragState } from "./editor/state";
import { verifyUser, verifyUserWithApplock } from "./functions";
import { SettingSection } from "./types";
import { getTimeLeft } from "./user-section";
-import { User } from "@notesnook/core";
export const settingsGroups: SettingSection[] = [
{
@@ -1194,7 +1194,12 @@ export const settingsGroups: SettingSection[] = [
{
id: "select-backup-dir",
name: strings.selectBackupDir(),
- description: strings.selectBackupDirDesc(),
+ description: () => {
+ const desc = strings.selectBackupDirDesc(
+ SettingsService.get().backupDirectoryAndroid?.path || ""
+ );
+ return desc[0] + " " + desc[1];
+ },
icon: "folder",
hidden: () =>
!!SettingsService.get().backupDirectoryAndroid ||
diff --git a/apps/mobile/app/services/backup.ts b/apps/mobile/app/services/backup.ts
index 033b37da6..b29daa338 100644
--- a/apps/mobile/app/services/backup.ts
+++ b/apps/mobile/app/services/backup.ts
@@ -85,9 +85,13 @@ async function checkBackupDirExists(reset = false, context = "global") {
resolve(await getDirectoryAndroid());
return;
}
+ const desc = strings.selectBackupDirDesc(
+ SettingsService.get().backupDirectoryAndroid?.path || ""
+ );
+
presentDialog({
title: strings.selectBackupDir(),
- paragraph: strings.selectBackupDirDesc(),
+ paragraph: desc[0] + " " + desc,
positivePress: async () => {
resolve(await getDirectoryAndroid());
},
diff --git a/apps/mobile/app/services/biometrics.ts b/apps/mobile/app/services/biometrics.ts
index bb5dc79a4..2b07d0671 100644
--- a/apps/mobile/app/services/biometrics.ts
+++ b/apps/mobile/app/services/biometrics.ts
@@ -23,7 +23,7 @@ import FingerprintScanner, {
} from "@ammarahmed/react-native-fingerprint-scanner";
import * as Keychain from "react-native-keychain";
import { MMKV } from "../common/database/mmkv";
-import Storage from "../common/database/storage";
+import { Storage } from "../common/database/storage";
import { useSettingStore } from "../stores/use-setting-store";
import { ToastOptions, ToastManager } from "./event-manager";
import { useUserStore } from "../stores/use-user-store";