Fix collection sharing/link copying using the local/relative collection URL (#38935)

This commit is contained in:
diondiondion 2026-05-07 12:27:24 +02:00 committed by GitHub
parent 11803e3d04
commit 9c8e1855a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -131,7 +131,7 @@ export const CollectionMenu: React.FC<{
{ {
text: intl.formatMessage(messages.copyLink), text: intl.formatMessage(messages.copyLink),
action: () => { action: () => {
void navigator.clipboard.writeText(getCollectionPath(id)); void navigator.clipboard.writeText(collection.url);
dispatch(showAlert({ message: messages.copyLinkConfirmation })); dispatch(showAlert({ message: messages.copyLinkConfirmation }));
}, },
}, },
@ -196,13 +196,14 @@ export const CollectionMenu: React.FC<{
id, id,
openShareModal, openShareModal,
isOwnCollection, isOwnCollection,
collection.url,
dispatch, dispatch,
openDeleteConfirmation, openDeleteConfirmation,
context, context,
currentAccountInCollection, currentAccountInCollection,
openReportModal, openReportModal,
openBlockModal,
openRevokeConfirmation, openRevokeConfirmation,
openBlockModal,
]); ]);
return ( return (

View File

@ -42,7 +42,7 @@ export const CollectionShareModal: React.FC<{
const isNew = !!location.state?.newCollection; const isNew = !!location.state?.newCollection;
const isOwnCollection = collection.account_id === me; const isOwnCollection = collection.account_id === me;
const collectionLink = `${window.location.origin}/collections/${collection.id}`; const collectionLink = collection.url;
const handleShareOnDevice = useCallback(() => { const handleShareOnDevice = useCallback(() => {
void navigator.share({ void navigator.share({