From 55e2c885b29c5e33fe439d2f4202d642a91004ea Mon Sep 17 00:00:00 2001 From: matty Date: Mon, 12 Jan 2026 02:05:21 +0000 Subject: [PATCH] modify copy/share for external profiles --- packages/pl-fe/src/components/status-action-bar.tsx | 11 +++++++---- .../pl-fe/src/features/account/components/header.tsx | 8 ++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/pl-fe/src/components/status-action-bar.tsx b/packages/pl-fe/src/components/status-action-bar.tsx index eb0ed5fe3..7c86d5d3c 100644 --- a/packages/pl-fe/src/components/status-action-bar.tsx +++ b/packages/pl-fe/src/components/status-action-bar.tsx @@ -676,7 +676,7 @@ const MenuButton: React.FC = ({ getOrCreateChatByAccountId(account.id) .then((chat) => navigate({ to: '/chats/{-$chatId}', params: { chatId: chat.id } })) - .catch(() => {}); + .catch(() => { }); }; const handleMuteClick: React.EventHandler = (e) => { @@ -717,15 +717,18 @@ const MenuButton: React.FC = ({ }; const handleCopy: React.EventHandler = (e) => { - const { uri } = status; + const localDomain = window.location.hostname !== 'localhost' ? window.location.hostname : 'localhost:7312'; + const copyString = `${window.location.protocol}//${localDomain}/@${status.account.acct}/posts/${status.id}`; - copy(uri); + copy(copyString); }; const handleShare = () => { + const localDomain = window.location.hostname !== 'localhost' ? window.location.hostname : 'localhost:7312'; + const copyString = `${window.location.protocol}//${localDomain}/@${status.account.acct}/posts/${status.id}`; navigator.share({ text: status.search_index, - url: status.uri, + url: copyString, }).catch((e) => { if (e.name !== 'AbortError') console.error(e); }); diff --git a/packages/pl-fe/src/features/account/components/header.tsx b/packages/pl-fe/src/features/account/components/header.tsx index d651ccd84..bc260c282 100644 --- a/packages/pl-fe/src/features/account/components/header.tsx +++ b/packages/pl-fe/src/features/account/components/header.tsx @@ -335,16 +335,20 @@ const Header: React.FC = ({ account }) => { }; const handleShare = () => { + const localDomain = window.location.hostname !== 'localhost' ? window.location.hostname : 'localhost:7312'; + const copyString = `${window.location.protocol}//${localDomain}/@${account.acct}`; navigator.share({ text: `@${account.acct}`, - url: account.url, + url: copyString, }).catch((e) => { if (e.name !== 'AbortError') console.error(e); }); }; const handleCopy: React.EventHandler = (e) => { - copy(account.url); + const localDomain = window.location.hostname !== 'localhost' ? window.location.hostname : 'localhost:7312'; + const copyString = `${window.location.protocol}//${localDomain}/@${account.acct}`; + copy(copyString); }; const makeMenu = () => {