Merge pull request #597 from graue/graue/copy-handle-with-instance
Include domain when copying local user's handle
This commit is contained in:
commit
808c6262d8
|
@ -568,9 +568,9 @@ function AccountInfo({
|
||||||
</div>
|
</div>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const handle = `@${acct}`;
|
const handleWithInstance = acct.includes('@') ? `@${acct}` : `@${acct}@${instance}`;
|
||||||
try {
|
try {
|
||||||
navigator.clipboard.writeText(handle);
|
navigator.clipboard.writeText(handleWithInstance);
|
||||||
showToast('Handle copied');
|
showToast('Handle copied');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
@ -924,6 +924,8 @@ function RelatedActions({
|
||||||
const [currentInfo, setCurrentInfo] = useState(null);
|
const [currentInfo, setCurrentInfo] = useState(null);
|
||||||
const [isSelf, setIsSelf] = useState(false);
|
const [isSelf, setIsSelf] = useState(false);
|
||||||
|
|
||||||
|
const acctWithInstance = acct.includes('@') ? acct : `${acct}@${instance}`;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (info) {
|
if (info) {
|
||||||
const currentAccount = getCurrentAccountID();
|
const currentAccount = getCurrentAccountID();
|
||||||
|
@ -1205,7 +1207,7 @@ function RelatedActions({
|
||||||
)}
|
)}
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const handle = `@${currentInfo?.acct || acct}`;
|
const handle = `@${currentInfo?.acct || acctWithInstance}`;
|
||||||
try {
|
try {
|
||||||
navigator.clipboard.writeText(handle);
|
navigator.clipboard.writeText(handle);
|
||||||
showToast('Handle copied');
|
showToast('Handle copied');
|
||||||
|
@ -1220,7 +1222,7 @@ function RelatedActions({
|
||||||
Copy handle
|
Copy handle
|
||||||
<br />
|
<br />
|
||||||
<span class="more-insignificant">
|
<span class="more-insignificant">
|
||||||
@{currentInfo?.acct || acct}
|
@{currentInfo?.acct || acctWithInstance}
|
||||||
</span>
|
</span>
|
||||||
</small>
|
</small>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
Loading…
Reference in a new issue