Fix ability for non-owners to change team visibility

This commit is contained in:
Justin Edmund 2023-10-11 11:22:52 +09:00
parent 7dd5d6988a
commit f0a22f6a56
2 changed files with 21 additions and 17 deletions

View file

@ -143,7 +143,7 @@ const Party = (props: Props) => {
// Methods: Updating the party's details
async function updateDetails(details: DetailsObject) {
if (!props.team) return await createParty(details)
else return await updateParty(details)
else if (party.editable) return await updateParty(details)
}
function formatDetailsObject(details: DetailsObject) {

View file

@ -345,13 +345,15 @@ const PartyHeader = (props: Props) => {
text={t('party.notices.buttons.copy_link')}
onClick={copyToClipboard}
/>
<Button
bound={true}
className="notice no-shrink"
key="change_visibility"
text={t('party.notices.buttons.change_visibility')}
onClick={() => handleVisibilityDialogChange(true)}
/>
{party.editable && (
<Button
bound={true}
className="notice no-shrink"
key="change_visibility"
text={t('party.notices.buttons.change_visibility')}
onClick={() => handleVisibilityDialogChange(true)}
/>
)}
</div>
</div>
)
@ -362,15 +364,17 @@ const PartyHeader = (props: Props) => {
<PrivateIcon />
</div>
<p>{t('party.notices.private')}</p>
<div className={styles.buttons}>
<Button
bound={true}
className="notice"
key="change_visibility"
text={t('party.notices.buttons.change_visibility')}
onClick={() => handleVisibilityDialogChange(true)}
/>
</div>
{party.editable && (
<div className={styles.buttons}>
<Button
bound={true}
className="notice"
key="change_visibility"
text={t('party.notices.buttons.change_visibility')}
onClick={() => handleVisibilityDialogChange(true)}
/>
</div>
)}
</div>
)