Disable Switch post menu if no post instance yet

This commit is contained in:
Lim Chee Aun 2023-11-25 21:25:01 +08:00
parent 25e13144a3
commit 1422c5da33

View file

@ -1100,7 +1100,7 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
<MenuDivider />
<MenuHeader className="plain">Experimental</MenuHeader>
<MenuItem
disabled={postSameInstance}
disabled={!postInstance || postSameInstance}
onClick={() => {
const statusURL = getInstanceStatusURL(heroStatus.url);
if (statusURL) {
@ -1112,7 +1112,15 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
>
<Icon icon="transfer" />
<small class="menu-double-lines">
Switch to post's instance (<b>{postInstance}</b>)
Switch to post's instance
{postInstance ? (
<>
{' '}
(<b>{postInstance}</b>)
</>
) : (
''
)}
</small>
</MenuItem>
</Menu2>