From 497cb5a96512e02c9f6ca12688f0939db69f6164 Mon Sep 17 00:00:00 2001 From: Kieran Cui <78460423+cuikaipeng@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:22:48 +0800 Subject: [PATCH] fix: save to Obsidian error in browser environment (#1040) --- apps/renderer/src/hooks/biz/useEntryActions.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/renderer/src/hooks/biz/useEntryActions.tsx b/apps/renderer/src/hooks/biz/useEntryActions.tsx index 1d8d19794..f69a747b0 100644 --- a/apps/renderer/src/hooks/biz/useEntryActions.tsx +++ b/apps/renderer/src/hooks/biz/useEntryActions.tsx @@ -403,9 +403,9 @@ export const useEntryActions = ({ name: t("entry_actions.save_to_obsidian"), icon: , key: "saveToObsidian", - hide: !isObsidianEnabled || !populatedEntry?.entries?.url, + hide: !isObsidianEnabled || !populatedEntry?.entries?.url || !IN_ELECTRON, onClick: () => { - if (!isObsidianEnabled || !populatedEntry?.entries?.url) return + if (!isObsidianEnabled || !populatedEntry?.entries?.url || !IN_ELECTRON) return saveToObsidian.mutate({ url: populatedEntry.entries.url,