modify copy/share for external profiles
Some checks failed
Some checks failed
This commit is contained in:
@ -676,7 +676,7 @@ const MenuButton: React.FC<IMenuButton> = ({
|
|||||||
|
|
||||||
getOrCreateChatByAccountId(account.id)
|
getOrCreateChatByAccountId(account.id)
|
||||||
.then((chat) => navigate({ to: '/chats/{-$chatId}', params: { chatId: chat.id } }))
|
.then((chat) => navigate({ to: '/chats/{-$chatId}', params: { chatId: chat.id } }))
|
||||||
.catch(() => {});
|
.catch(() => { });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleMuteClick: React.EventHandler<React.MouseEvent> = (e) => {
|
const handleMuteClick: React.EventHandler<React.MouseEvent> = (e) => {
|
||||||
@ -717,15 +717,18 @@ const MenuButton: React.FC<IMenuButton> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCopy: React.EventHandler<React.MouseEvent> = (e) => {
|
const handleCopy: React.EventHandler<React.MouseEvent> = (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 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({
|
navigator.share({
|
||||||
text: status.search_index,
|
text: status.search_index,
|
||||||
url: status.uri,
|
url: copyString,
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
if (e.name !== 'AbortError') console.error(e);
|
if (e.name !== 'AbortError') console.error(e);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -335,16 +335,20 @@ const Header: React.FC<IHeader> = ({ account }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleShare = () => {
|
const handleShare = () => {
|
||||||
|
const localDomain = window.location.hostname !== 'localhost' ? window.location.hostname : 'localhost:7312';
|
||||||
|
const copyString = `${window.location.protocol}//${localDomain}/@${account.acct}`;
|
||||||
navigator.share({
|
navigator.share({
|
||||||
text: `@${account.acct}`,
|
text: `@${account.acct}`,
|
||||||
url: account.url,
|
url: copyString,
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
if (e.name !== 'AbortError') console.error(e);
|
if (e.name !== 'AbortError') console.error(e);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCopy: React.EventHandler<React.MouseEvent> = (e) => {
|
const handleCopy: React.EventHandler<React.MouseEvent> = (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 = () => {
|
const makeMenu = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user