From ae1cb5ee5dc1de7ddfc03781987cb7c172baf65d Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Wed, 8 Jan 2025 02:52:30 +0800 Subject: [PATCH] chore: hide customize toolbar action in mobile --- apps/renderer/src/modules/customize-toolbar/modal.tsx | 4 +--- apps/renderer/src/modules/entry-content/header.mobile.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/renderer/src/modules/customize-toolbar/modal.tsx b/apps/renderer/src/modules/customize-toolbar/modal.tsx index 91ce7e513..06aae22b4 100644 --- a/apps/renderer/src/modules/customize-toolbar/modal.tsx +++ b/apps/renderer/src/modules/customize-toolbar/modal.tsx @@ -46,15 +46,13 @@ const CustomizeToolbar = () => { // Moving between containers const sourceList = isActiveInMain ? "main" : "more" const targetList = isActiveInMain ? "more" : "main" - const item = actionOrder[sourceList].find((item) => item === activeId) - if (!item) return const newIndexOfOver = actionOrder[targetList].indexOf(overId) setUISetting("toolbarOrder", { ...actionOrder, [sourceList]: actionOrder[sourceList].filter((item) => item !== activeId), [targetList]: [ ...actionOrder[targetList].slice(0, newIndexOfOver), - item, + activeId, ...actionOrder[targetList].slice(newIndexOfOver), ], }) diff --git a/apps/renderer/src/modules/entry-content/header.mobile.tsx b/apps/renderer/src/modules/entry-content/header.mobile.tsx index cca4a34b2..d674d63df 100644 --- a/apps/renderer/src/modules/entry-content/header.mobile.tsx +++ b/apps/renderer/src/modules/entry-content/header.mobile.tsx @@ -28,7 +28,12 @@ function EntryHeaderImpl({ view, entryId, className }: EntryHeaderProps) { const actionConfigs = useEntryActions({ entryId, view }).filter( (item) => !( - [COMMAND_ID.entry.read, COMMAND_ID.entry.unread, COMMAND_ID.entry.copyLink] as string[] + [ + COMMAND_ID.entry.read, + COMMAND_ID.entry.unread, + COMMAND_ID.entry.copyLink, + COMMAND_ID.settings.customizeToolbar, + ] as string[] ).includes(item.id), )