Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(mobile): address requested changes
Elian Dorane0b4ebed9357
diff --git a/apps/client/src/widgets/NoteDetail.tsx b/apps/client/src/widgets/NoteDetail.tsxindex 14b7fc3b53..4c3e778f1b 100644--- a/apps/client/src/widgets/NoteDetail.tsx+++ b/apps/client/src/widgets/NoteDetail.tsx@@ -1,7 +1,6 @@import "./NoteDetail.css";import clsx from "clsx";-import { use } from "i18next";import { isValidElement, VNode } from "preact";import { useEffect, useRef, useState } from "preact/hooks";@@ -16,7 +15,7 @@ import toast from "../services/toast.js";import { dynamicRequire, isElectron, isMobile } from "../services/utils";import NoteTreeWidget from "./note_tree";import { ExtendedNoteType, TYPE_MAPPINGS, TypeWidget } from "./note_types";-import { useLegacyWidget, useNote, useNoteContext, useTriliumEvent } from "./react/hooks";+import { useLegacyWidget, useNoteContext, useTriliumEvent } from "./react/hooks";import { NoteListWithLinks } from "./react/NoteList";import { TypeWidgetProps } from "./type_widgets/type_widget";diff --git a/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx b/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsxindex ed3d735d1c..ff92b6512e 100644--- a/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx+++ b/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx@@ -211,7 +211,7 @@ function TabPreviewContent({ note, viewScope }: {el = <PreviewPlaceholder icon="bx bx-plus" />;} else if (note.type === "book") {el = <PreviewPlaceholder icon={ICON_MAPPINGS[note.getLabelValue("viewType") ?? ""] ?? "bx bx-book"} />;- } else if (viewScope?.viewMode !== "default") {+ } else if (viewScope?.viewMode && viewScope.viewMode !== "default") {el = <PreviewPlaceholder icon={VIEW_MODE_ICON_MAPPINGS[viewScope?.viewMode ?? ""] ?? "bx bx-empty"} />;} else {el = <NoteContentdiff --git a/apps/client/src/widgets/type_widgets/text/mobile_editor_toolbar.tsx b/apps/client/src/widgets/type_widgets/text/mobile_editor_toolbar.tsxindex 8b266b3612..2d40315525 100644--- a/apps/client/src/widgets/type_widgets/text/mobile_editor_toolbar.tsx+++ b/apps/client/src/widgets/type_widgets/text/mobile_editor_toolbar.tsx@@ -21,7 +21,7 @@ export default function MobileEditorToolbar({ inPopupEditor }: MobileEditorToolbconst { note, noteContext, ntxId } = useNoteContext();const noteType = useNoteProperty(note, "type");const { isReadOnly } = useIsNoteReadOnly(note, noteContext);- const shouldDisplay = noteType === "text" && !isReadOnly;+ const shouldDisplay = noteType === "text" && isReadOnly === false;const [ dropdownActive, setDropdownActive ] = useState(false);usePositioningOniOS(!inPopupEditor, containerRef);