diff --git a/apps/mobile/app/components/announcements/announcement.js b/apps/mobile/app/components/announcements/announcement.js index 5e80d59f5..4e9e058d2 100644 --- a/apps/mobile/app/components/announcements/announcement.js +++ b/apps/mobile/app/components/announcements/announcement.js @@ -17,11 +17,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -import React from "react"; -import { FlatList, View } from "react-native"; -import { useSelectionStore } from "../../stores/use-selection-store"; -import { useMessageStore } from "../../stores/use-message-store"; import { useThemeColors } from "@notesnook/theme"; +import React from "react"; +import { View } from "react-native"; +import { useMessageStore } from "../../stores/use-message-store"; +import { useSelectionStore } from "../../stores/use-selection-store"; import { allowedOnPlatform, renderItem } from "./functions"; export const Announcement = ({ color }) => { diff --git a/apps/mobile/app/components/auth/session-expired.js b/apps/mobile/app/components/auth/session-expired.js index b99edd99a..a42c5edcc 100644 --- a/apps/mobile/app/components/auth/session-expired.js +++ b/apps/mobile/app/components/auth/session-expired.js @@ -19,7 +19,7 @@ along with this program. If not, see . import { useThemeColors } from "@notesnook/theme"; import React, { useEffect, useState } from "react"; -import { Modal, View } from "react-native"; +import { View } from "react-native"; import { db } from "../../common/database"; import { MMKV } from "../../common/database/mmkv"; import BiometricService from "../../services/biometrics"; @@ -37,6 +37,7 @@ import { eLoginSessionExpired, eUserLoggedIn } from "../../utils/events"; import { SIZE } from "../../utils/size"; import { sleep } from "../../utils/time"; import { Dialog } from "../dialog"; +import BaseDialog from "../dialog/base-dialog"; import { presentDialog } from "../dialog/functions"; import SheetProvider from "../sheet-provider"; import { Toast } from "../toast"; @@ -46,7 +47,6 @@ import Input from "../ui/input"; import Heading from "../ui/typography/heading"; import Paragraph from "../ui/typography/paragraph"; import { LoginSteps, useLogin } from "./use-login"; -import BaseDialog from "../dialog/base-dialog"; function getObfuscatedEmail(email) { if (!email) return ""; diff --git a/apps/mobile/app/components/list/index.js b/apps/mobile/app/components/list/index.js index 6433aab03..7e54da0c8 100644 --- a/apps/mobile/app/components/list/index.js +++ b/apps/mobile/app/components/list/index.js @@ -17,15 +17,17 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +import { getTotalNotes } from "@notesnook/common"; +import { useThemeColors } from "@notesnook/theme"; +import { FlashList } from "@shopify/flash-list"; import React, { useEffect, useRef } from "react"; import { RefreshControl, View } from "react-native"; -import { FlashList } from "@shopify/flash-list"; import Animated, { FadeInDown } from "react-native-reanimated"; import { notesnook } from "../../../e2e/test.ids"; +import { useGroupOptions } from "../../hooks/use-group-options"; import { eSendEvent } from "../../services/event-manager"; import Sync from "../../services/sync"; -import { useThemeColors } from "@notesnook/theme"; -import { db } from "../../common/database"; +import { useSettingStore } from "../../stores/use-setting-store"; import { eScrollEvent } from "../../utils/events"; import { tabBarRef } from "../../utils/global-refs"; import JumpToSectionDialog from "../dialogs/jump-to-section"; @@ -34,12 +36,9 @@ import { Header } from "../list-items/headers/header"; import { SectionHeader } from "../list-items/headers/section-header"; import { NoteWrapper } from "../list-items/note/wrapper"; import { NotebookWrapper } from "../list-items/notebook/wrapper"; +import ReminderItem from "../list-items/reminder"; import TagItem from "../list-items/tag"; import { Empty } from "./empty"; -import { getTotalNotes } from "@notesnook/common"; -import { useSettingStore } from "../../stores/use-setting-store"; -import ReminderItem from "../list-items/reminder"; -import { useGroupOptions } from "../../hooks/use-group-options"; const renderItems = { note: NoteWrapper, diff --git a/apps/mobile/app/components/merge-conflicts/index.js b/apps/mobile/app/components/merge-conflicts/index.js index 79cfa97be..cd4158e6c 100644 --- a/apps/mobile/app/components/merge-conflicts/index.js +++ b/apps/mobile/app/components/merge-conflicts/index.js @@ -17,9 +17,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +import { getFormattedDate } from "@notesnook/common"; +import { useThemeColors } from "@notesnook/theme"; import KeepAwake from "@sayem314/react-native-keep-awake"; import React, { useEffect, useRef, useState } from "react"; -import { Modal, SafeAreaView, Text, View } from "react-native"; +import { SafeAreaView, Text, View } from "react-native"; import Animated from "react-native-reanimated"; import { db } from "../../common/database"; import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets"; @@ -33,7 +35,7 @@ import { } from "../../services/event-manager"; import Navigation from "../../services/navigation"; import Sync from "../../services/sync"; -import { useThemeColors } from "@notesnook/theme"; +import { useSettingStore } from "../../stores/use-setting-store"; import { eOnLoadNote, eShowMergeDialog } from "../../utils/events"; import { SIZE } from "../../utils/size"; import { sleep } from "../../utils/time"; @@ -45,8 +47,6 @@ import { Button } from "../ui/button"; import { IconButton } from "../ui/icon-button"; import Seperator from "../ui/seperator"; import Paragraph from "../ui/typography/paragraph"; -import { useSettingStore } from "../../stores/use-setting-store"; -import { getFormattedDate } from "@notesnook/common"; const MergeConflicts = () => { const { colors } = useThemeColors(); diff --git a/apps/mobile/app/components/note-history/preview.js b/apps/mobile/app/components/note-history/preview.js index 7d1246cc4..4e856575d 100644 --- a/apps/mobile/app/components/note-history/preview.js +++ b/apps/mobile/app/components/note-history/preview.js @@ -17,20 +17,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +import { useThemeColors } from "@notesnook/theme"; import React from "react"; import { View } from "react-native"; import { db } from "../../common/database"; import Editor from "../../screens/editor"; -import EditorOverlay from "../../screens/editor/loading"; import { editorController } from "../../screens/editor/tiptap/utils"; import { eSendEvent, ToastEvent } from "../../services/event-manager"; import Navigation from "../../services/navigation"; import { useEditorStore } from "../../stores/use-editor-store"; import { useSelectionStore } from "../../stores/use-selection-store"; -import { useThemeColors } from "@notesnook/theme"; import { useTrashStore } from "../../stores/use-trash-store"; import { eCloseSheet, eOnLoadNote } from "../../utils/events"; -import { sleep } from "../../utils/time"; import { Dialog } from "../dialog"; import DialogHeader from "../dialog/dialog-header"; import { presentDialog } from "../dialog/functions"; diff --git a/apps/mobile/app/components/properties/index.js b/apps/mobile/app/components/properties/index.js index d32c065a1..6fc016b18 100644 --- a/apps/mobile/app/components/properties/index.js +++ b/apps/mobile/app/components/properties/index.js @@ -16,14 +16,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -import React, { useRef } from "react"; -import { Dimensions, Platform, View, useWindowDimensions } from "react-native"; +import { useThemeColors } from "@notesnook/theme"; +import React from "react"; +import { Platform, View } from "react-native"; import { FlatList } from "react-native-actions-sheet"; import { db } from "../../common/database"; import { DDS } from "../../services/device-detection"; import { presentSheet } from "../../services/event-manager"; import SearchService from "../../services/search"; -import { useThemeColors } from "@notesnook/theme"; import { ColorValues } from "../../utils/colors"; import { SIZE } from "../../utils/size"; import SheetProvider from "../sheet-provider"; @@ -34,7 +34,7 @@ import { DateMeta } from "./date-meta"; import { Items } from "./items"; import Notebooks from "./notebooks"; import { Synced } from "./synced"; -import { Tags, TagStrip } from "./tags"; +import { TagStrip, Tags } from "./tags"; const Line = ({ top = 6, bottom = 6 }) => { const { colors } = useThemeColors(); return ( diff --git a/apps/mobile/app/components/sheets/relations-list/index.tsx b/apps/mobile/app/components/sheets/relations-list/index.tsx index 962fd8e37..4d50799a3 100644 --- a/apps/mobile/app/components/sheets/relations-list/index.tsx +++ b/apps/mobile/app/components/sheets/relations-list/index.tsx @@ -16,19 +16,18 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -import React, { RefObject, useEffect, useState } from "react"; +import { useThemeColors } from "@notesnook/theme"; +import React, { RefObject } from "react"; import { View } from "react-native"; import { ActionSheetRef } from "react-native-actions-sheet"; import { FlashList } from "react-native-actions-sheet/dist/src/views/FlashList"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import { db } from "../../../common/database"; import { - presentSheet, - PresentSheetOptions + PresentSheetOptions, + presentSheet } from "../../../services/event-manager"; -import { Reminder } from "../../../services/notifications"; import { useRelationStore } from "../../../stores/use-relation-store"; -import { useThemeColors } from "@notesnook/theme"; import { SIZE } from "../../../utils/size"; import DialogHeader from "../../dialog/dialog-header"; import List from "../../list"; diff --git a/apps/mobile/app/components/side-menu/menu-item.js b/apps/mobile/app/components/side-menu/menu-item.js index e0b0bd085..2ddf25fd3 100644 --- a/apps/mobile/app/components/side-menu/menu-item.js +++ b/apps/mobile/app/components/side-menu/menu-item.js @@ -19,7 +19,7 @@ along with this program. If not, see . import { useThemeColors } from "@notesnook/theme"; import React, { useCallback, useEffect, useState } from "react"; -import { Dimensions, View } from "react-native"; +import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import ToggleSwitch from "toggle-switch-react-native"; import Navigation from "../../services/navigation"; diff --git a/apps/mobile/app/components/ui/icon-button/index.tsx b/apps/mobile/app/components/ui/icon-button/index.tsx index 76d6f40b7..1ae59d26d 100644 --- a/apps/mobile/app/components/ui/icon-button/index.tsx +++ b/apps/mobile/app/components/ui/icon-button/index.tsx @@ -20,7 +20,6 @@ along with this program. If not, see . import { useThemeColors } from "@notesnook/theme"; import React from "react"; import { ColorValue, GestureResponderEvent, TextStyle } from "react-native"; -import Animated, { Layout } from "react-native-reanimated"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import { RGB_Linear_Shade, hexToRGBA } from "../../../utils/colors"; import { SIZE } from "../../../utils/size"; diff --git a/apps/mobile/app/hooks/use-app-events.js b/apps/mobile/app/hooks/use-app-events.js index 4a521a98f..55261b524 100644 --- a/apps/mobile/app/hooks/use-app-events.js +++ b/apps/mobile/app/hooks/use-app-events.js @@ -481,7 +481,7 @@ export const useAppEvents = () => { subscribeToIAPListeners(); } catch (e) { - DatabaseLogger.error(error); + DatabaseLogger.error(e); ToastEvent.error(e, "An error occurred", "global"); } @@ -509,7 +509,9 @@ export const useAppEvents = () => { if (Platform.OS === "android") { try { await RNIap.flushFailedPurchasesCachedAsPendingAndroid(); - } catch (e) {} + } catch (e) { + e; + } } refValues.current.subsriptionSuccessListener = RNIap.purchaseUpdatedListener(onSuccessfulSubscription); @@ -631,7 +633,7 @@ export const useAppEvents = () => { } if (IsDatabaseMigrationRequired()) return; initialize(); - setLoading(false); + useNoteStore.getState().setLoading(false); Walkthrough.init(); } catch (e) { DatabaseLogger.error(e); diff --git a/apps/mobile/app/screens/editor/index.tsx b/apps/mobile/app/screens/editor/index.tsx index dc6595697..63f31ef8e 100755 --- a/apps/mobile/app/screens/editor/index.tsx +++ b/apps/mobile/app/screens/editor/index.tsx @@ -18,7 +18,7 @@ along with this program. If not, see . */ /* eslint-disable @typescript-eslint/no-var-requires */ -import { EV, EVENTS } from "@notesnook/core/dist/common"; +import { useThemeColors } from "@notesnook/theme"; import React, { forwardRef, useCallback, @@ -45,7 +45,6 @@ import { EditorProps, useEditorType } from "./tiptap/types"; import { useEditor } from "./tiptap/use-editor"; import { useEditorEvents } from "./tiptap/use-editor-events"; import { editorController } from "./tiptap/utils"; -import { useThemeColors } from "@notesnook/theme"; const style: ViewStyle = { height: "100%", diff --git a/apps/mobile/app/screens/editor/wrapper.js b/apps/mobile/app/screens/editor/wrapper.js index fe3c6e8c7..38f89e825 100644 --- a/apps/mobile/app/screens/editor/wrapper.js +++ b/apps/mobile/app/screens/editor/wrapper.js @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +import { useThemeColors } from "@notesnook/theme"; import React, { useEffect, useRef } from "react"; import { AppState, @@ -32,9 +33,7 @@ import useIsFloatingKeyboard from "../../hooks/use-is-floating-keyboard"; import useKeyboard from "../../hooks/use-keyboard"; import { DDS } from "../../services/device-detection"; import { useSettingStore } from "../../stores/use-setting-store"; -import { useThemeColors } from "@notesnook/theme"; import { editorRef } from "../../utils/global-refs"; -import { ProgressBar } from "./progress"; import { editorController, textInput } from "./tiptap/utils"; export const EditorWrapper = ({ width }) => { @@ -115,7 +114,6 @@ export const EditorWrapper = ({ width }) => { style={{ height: 1, padding: 0, width: 1, position: "absolute" }} blurOnSubmit={false} /> - {/* */} )} diff --git a/apps/mobile/app/services/message.js b/apps/mobile/app/services/message.js index b4e42a5c5..7e407c6d1 100644 --- a/apps/mobile/app/services/message.js +++ b/apps/mobile/app/services/message.js @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ - +import React from "react"; import { Platform } from "react-native"; import { verifyUser } from "../screens/settings/functions"; import { useMessageStore } from "../stores/use-message-store";