chore(mobile): address requested changes

This commit is contained in:
Elian Doran 2026-02-04 18:40:30 +02:00
parent ac3b289c9e
commit e0b4ebed93
No known key found for this signature in database
3 changed files with 3 additions and 4 deletions

View File

@ -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";

View File

@ -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 = <NoteContent

View File

@ -21,7 +21,7 @@ export default function MobileEditorToolbar({ inPopupEditor }: MobileEditorToolb
const { 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);