fix: sidebar copy feed url, fixed #1361

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2024-11-03 21:50:53 +08:00
parent cb6a65b7cc
commit 4e841964e6
@@ -65,6 +65,8 @@ export const useFeedActions = ({
type: feed.type,
ownerUserId: feed.ownerUserId,
id: feed.id,
url: feed.url,
siteUrl: feed.siteUrl,
}
})
const inbox = useInboxById(feedId)
@@ -273,10 +275,10 @@ export const useFeedActions = ({
disabled: isEntryList,
shortcut: "Meta+C",
click: () => {
// @ts-expect-error
const { url } = feed || {}
if (!url) return
navigator.clipboard.writeText(url)
const { url, siteUrl } = feed || {}
const copied = url || siteUrl
if (!copied) return
navigator.clipboard.writeText(copied)
},
},
{