Don't allow self to mention self lolol

This commit is contained in:
Lim Chee Aun 2023-03-18 20:40:16 +08:00
parent a0d4d9e08c
commit 4f3d503a35

View file

@ -407,6 +407,7 @@ function RelatedActions({ info, instance, authenticated }) {
} = relationship || {}; } = relationship || {};
const [currentInfo, setCurrentInfo] = useState(null); const [currentInfo, setCurrentInfo] = useState(null);
const [isSelf, setIsSelf] = useState(false);
useEffect(() => { useEffect(() => {
if (info) { if (info) {
@ -439,6 +440,7 @@ function RelatedActions({ info, instance, authenticated }) {
if (currentAccount === currentID) { if (currentAccount === currentID) {
// It's myself! // It's myself!
setIsSelf(true);
return; return;
} }
@ -543,7 +545,7 @@ function RelatedActions({ info, instance, authenticated }) {
</button> </button>
} }
> >
{currentAuthenticated && ( {currentAuthenticated && !isSelf && (
<> <>
<MenuItem <MenuItem
onClick={() => { onClick={() => {