diff --git a/apps/web/src/components/editor/footer.tsx b/apps/web/src/components/editor/footer.tsx index d4c35c999..4177742ef 100644 --- a/apps/web/src/components/editor/footer.tsx +++ b/apps/web/src/components/editor/footer.tsx @@ -32,7 +32,7 @@ function EditorFooter() { const activeSessionId = useEditorStore((store) => store.activeSessionId); const { words } = useNoteStatistics(activeSessionId || "unknown"); const saveState = useEditorStore( - (store) => store.getActiveSession(["default", "unlocked"])?.saveState + (store) => store.getActiveSession(["default"])?.saveState ); const SaveStateIcon = saveState ? SAVE_STATE_ICON_MAP[saveState] : null; diff --git a/apps/web/src/components/note/index.tsx b/apps/web/src/components/note/index.tsx index 8d11296f8..372bdc1c6 100644 --- a/apps/web/src/components/note/index.tsx +++ b/apps/web/src/components/note/index.tsx @@ -85,7 +85,7 @@ import { } from "@notesnook/common"; import { Color, - Note, + Note as NoteType, Notebook as NotebookItem, Tag, createInternalLink @@ -94,11 +94,10 @@ import { MenuItem } from "@notesnook/ui"; import { Context } from "../list-container/types"; import { SchemeColors } from "@notesnook/theme"; import FileSaver from "file-saver"; -import Vault from "../../common/vault"; import { writeToClipboard } from "../../utils/clipboard"; type NoteProps = NoteResolvedData & { - item: Note; + item: NoteType; context?: Context; date: number; simplified?: boolean; @@ -326,7 +325,7 @@ const formats = [ const notFullySyncedText = "Cannot perform this action because note is not fully synced."; const menuItems: ( - note: Note, + note: NoteType, ids?: string[], context?: { color?: Color; locked?: boolean } ) => MenuItem[] = (note, ids = [], context) => { diff --git a/apps/web/src/components/notebook/index.tsx b/apps/web/src/components/notebook/index.tsx index f3902a7f2..e2e65e2e2 100644 --- a/apps/web/src/components/notebook/index.tsx +++ b/apps/web/src/components/notebook/index.tsx @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -import React, { useCallback, useRef } from "react"; +import React, { useRef } from "react"; import { Flex, Text } from "@theme-ui/components"; import ListItem from "../list-item"; import { useStore, store } from "../../stores/notebook-store"; @@ -41,12 +41,12 @@ import { pluralize } from "@notesnook/common"; import { confirm } from "../../common/dialog-controller"; import { getFormattedDate } from "@notesnook/common"; import { MenuItem } from "@notesnook/ui"; -import { Notebook } from "@notesnook/core"; +import { Notebook as NotebookType } from "@notesnook/core"; import { handleDrop } from "../../common/drop-handler"; import { useDragHandler } from "../../hooks/use-drag-handler"; type NotebookProps = { - item: Notebook; + item: NotebookType; totalNotes: number; date: number; simplified?: boolean; @@ -148,7 +148,7 @@ export default React.memo(Notebook, (prev, next) => { }); export const notebookMenuItems: ( - notebook: Notebook, + notebook: NotebookType, ids?: string[] ) => MenuItem[] = (notebook, ids = []) => { const defaultNotebook = db.settings.getDefaultNotebook(); @@ -231,7 +231,7 @@ export const notebookMenuItems: ( ]; }; -async function openNotebook(notebook: Notebook, totalNotes?: number) { +async function openNotebook(notebook: NotebookType, totalNotes?: number) { await useNotesStore.getState().setContext({ type: "notebook", id: notebook.id, diff --git a/apps/web/src/components/tag/index.tsx b/apps/web/src/components/tag/index.tsx index 223ca3f69..e7d3f973e 100644 --- a/apps/web/src/components/tag/index.tsx +++ b/apps/web/src/components/tag/index.tsx @@ -29,11 +29,11 @@ import { Edit, Shortcut, DeleteForver } from "../icons"; import { showToast } from "../../utils/toast"; import { pluralize } from "@notesnook/common"; import { MenuItem } from "@notesnook/ui"; -import { Tag } from "@notesnook/core/dist/types"; +import { Tag as TagType } from "@notesnook/core"; import { showEditTagDialog } from "../../common/dialog-controller"; import { handleDrop } from "../../common/drop-handler"; -type TagProps = { item: Tag; totalNotes: number }; +type TagProps = { item: TagType; totalNotes: number }; function Tag(props: TagProps) { const { item, totalNotes } = props; const { id, title } = item; @@ -68,7 +68,10 @@ function Tag(props: TagProps) { } export default Tag; -const menuItems: (tag: Tag, ids?: string[]) => MenuItem[] = (tag, ids = []) => { +const menuItems: (tag: TagType, ids?: string[]) => MenuItem[] = ( + tag, + ids = [] +) => { return [ { type: "button", diff --git a/apps/web/src/components/trash-item/index.tsx b/apps/web/src/components/trash-item/index.tsx index 2205574b8..813d45bfc 100644 --- a/apps/web/src/components/trash-item/index.tsx +++ b/apps/web/src/components/trash-item/index.tsx @@ -26,11 +26,10 @@ import TimeAgo from "../time-ago"; import { pluralize, toTitleCase } from "@notesnook/common"; import { showToast } from "../../utils/toast"; import { MenuItem } from "@notesnook/ui"; -import { TrashItem } from "@notesnook/core/dist/types"; -import { db } from "../../common/db"; +import { TrashItem as TrashItemType } from "@notesnook/core/dist/types"; import { useEditorStore } from "../../stores/editor-store"; -type TrashItemProps = { item: TrashItem; date: number }; +type TrashItemProps = { item: TrashItemType; date: number }; function TrashItem(props: TrashItemProps) { const { item, date } = props; const isOpened = useEditorStore((store) => store.activeSessionId === item.id); @@ -65,7 +64,7 @@ function TrashItem(props: TrashItemProps) { } export default TrashItem; -const menuItems: (item: TrashItem, ids?: string[]) => MenuItem[] = ( +const menuItems: (item: TrashItemType, ids?: string[]) => MenuItem[] = ( item, ids = [] ) => { diff --git a/apps/web/src/dialogs/settings/index.tsx b/apps/web/src/dialogs/settings/index.tsx index e5b5fa113..ee19d2720 100644 --- a/apps/web/src/dialogs/settings/index.tsx +++ b/apps/web/src/dialogs/settings/index.tsx @@ -37,8 +37,7 @@ import { Privacy, Pro, ShieldLock, - Sync, - Proxy + Sync } from "../../components/icons"; import { Perform } from "../../common/dialog-controller"; import NavigationItem from "../../components/navigation-menu/navigation-item"; diff --git a/apps/web/src/stores/reminder-store.ts b/apps/web/src/stores/reminder-store.ts index 39859bc2a..8e01d03aa 100644 --- a/apps/web/src/stores/reminder-store.ts +++ b/apps/web/src/stores/reminder-store.ts @@ -120,10 +120,10 @@ function scheduleReminder(id: string, reminder: Reminder, cron: string) { } else { const notification = new Notification(reminder.title, { body: reminder.description, - vibrate: reminder.priority === "vibrate" ? 200 : undefined, + // vibrate: reminder.priority === "vibrate" ? 200 : undefined, silent: reminder.priority === "silent", tag: id, - renotify: true, + // renotify: true, requireInteraction: true }); diff --git a/apps/web/src/stores/setting-store.ts b/apps/web/src/stores/setting-store.ts index e45928516..857bd51e7 100644 --- a/apps/web/src/stores/setting-store.ts +++ b/apps/web/src/stores/setting-store.ts @@ -156,10 +156,9 @@ class SettingStore extends BaseStore { Config.set("doubleSpacedLines", !doubleSpacedParagraphs); }; - toggleMarkdownShortcuts = (toggleState) => { + toggleMarkdownShortcuts = (toggleState?: boolean) => { this.set((state) => { - state.markdownShortcuts = - toggleState !== undefined ? toggleState : !state.markdownShortcuts; + state.markdownShortcuts = toggleState ?? !state.markdownShortcuts; Config.set("markdownShortcuts", state.markdownShortcuts); }); };