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 // Methods: Updating the party's details
async function updateDetails(details: DetailsObject) { async function updateDetails(details: DetailsObject) {
if (!props.team) return await createParty(details) if (!props.team) return await createParty(details)
else return await updateParty(details) else if (party.editable) return await updateParty(details)
} }
function formatDetailsObject(details: DetailsObject) { function formatDetailsObject(details: DetailsObject) {

View file

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