Lock down unauth authentication

Fixes #97
This commit is contained in:
Justin Edmund 2022-12-30 03:52:21 -08:00
parent 6a7a484f4f
commit 7580e544fe
3 changed files with 12 additions and 5 deletions

View file

@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import React from 'react'
import UncapStar from '~components/UncapStar'
import './index.scss'

View file

@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import React from 'react'
import classnames from 'classnames'
import './index.scss'

View file

@ -18,6 +18,7 @@ import type { SearchableObject } from '~types'
import './index.scss'
import WeaponConflictModal from '~components/WeaponConflictModal'
import Alert from '~components/Alert'
import { accountState } from '~utils/accountState'
// Props
interface Props {
@ -230,10 +231,16 @@ const WeaponGrid = (props: Props) => {
position: number,
uncapLevel: number
) {
memoizeAction(id, position, uncapLevel)
if (
party.user &&
accountState.account.user &&
party.user.id === accountState.account.user.id
) {
memoizeAction(id, position, uncapLevel)
// Optimistically update UI
updateUncapLevel(position, uncapLevel)
// Optimistically update UI
updateUncapLevel(position, uncapLevel)
}
}
const memoizeAction = useCallback(