Skip to content

Build your personal knowledge base with Trilium Notes

feat(options/media): hide spellcheck related setting in browser

Elian Doran620a08012802
diff --git a/apps/client/src/widgets/type_widgets/options/components/RelatedSettings.tsx b/apps/client/src/widgets/type_widgets/options/components/RelatedSettings.tsx
index 5a26f51fd0..660a0df973 100644
--- a/apps/client/src/widgets/type_widgets/options/components/RelatedSettings.tsx
+++ b/apps/client/src/widgets/type_widgets/options/components/RelatedSettings.tsx
@@ -7,6 +7,7 @@ interface RelatedSettingsItem {
title: string;
description?: string;
targetPage: OptionPages;
+ enabled?: boolean;
}
interface RelatedSettingsProps {
@@ -14,9 +15,15 @@ interface RelatedSettingsProps {
}
export default function RelatedSettings({ items }: RelatedSettingsProps) {
+ const filteredItems = items.filter(item => item.enabled !== false);
+
+ if (filteredItems.length === 0) {
+ return null;
+ }
+
return (
<OptionsSection title={t("settings.related_settings")}>
- {items.map((item) => (
+ {filteredItems.map((item) => (
<OptionsRowLink
key={item.targetPage}
label={item.title}
diff --git a/apps/client/src/widgets/type_widgets/options/media.tsx b/apps/client/src/widgets/type_widgets/options/media.tsx
index 6e37b60985..ba90385016 100644
--- a/apps/client/src/widgets/type_widgets/options/media.tsx
+++ b/apps/client/src/widgets/type_widgets/options/media.tsx
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useRef, useState } from "preact/hooks";
import { t } from "../../../services/i18n";
import server from "../../../services/server";
import toast from "../../../services/toast";
+import { isElectron } from "../../../services/utils";
import { FormTextBoxWithUnit } from "../../react/FormTextBox";
import FormToggle from "../../react/FormToggle";
import { useTriliumOption, useTriliumOptionBool } from "../../react/hooks";
@@ -93,7 +94,8 @@ function OcrSettings() {
<RelatedSettings items={[
{
title: t("images.ocr_related_content_languages"),
- targetPage: "_optionsLocalization"
+ targetPage: "_optionsLocalization",
+ enabled: isElectron(), // This setting is only relevant for desktop, as web browsers use their own native OCR which doesn't support language selection.
}
]} />
</>