fix: copy page link url (#5263)

This commit is contained in:
Aaryan Khandelwal 2024-07-30 13:53:45 +05:30 committed by GitHub
parent f2af5f0653
commit 1adfb4dbe4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,7 +108,10 @@ export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
{
key: "copy-page-link",
action: () => {
copyUrlToClipboard(`${workspaceSlug?.toString()}/projects/${projectId?.toString()}/pages/${id}`).then(() =>
const pageLink = projectId
? `${workspaceSlug?.toString()}/projects/${projectId?.toString()}/pages/${id}`
: `${workspaceSlug?.toString()}/pages/${id}`;
copyUrlToClipboard(pageLink).then(() =>
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",