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
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 6 additions and 4 deletions

View File

@ -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)
},
},
{