parent
6a7a484f4f
commit
7580e544fe
3 changed files with 12 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect } from 'react'
|
import React from 'react'
|
||||||
import UncapStar from '~components/UncapStar'
|
import UncapStar from '~components/UncapStar'
|
||||||
|
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect } from 'react'
|
import React from 'react'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
|
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import type { SearchableObject } from '~types'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
import WeaponConflictModal from '~components/WeaponConflictModal'
|
import WeaponConflictModal from '~components/WeaponConflictModal'
|
||||||
import Alert from '~components/Alert'
|
import Alert from '~components/Alert'
|
||||||
|
import { accountState } from '~utils/accountState'
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
@ -230,10 +231,16 @@ const WeaponGrid = (props: Props) => {
|
||||||
position: number,
|
position: number,
|
||||||
uncapLevel: 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
|
// Optimistically update UI
|
||||||
updateUncapLevel(position, uncapLevel)
|
updateUncapLevel(position, uncapLevel)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const memoizeAction = useCallback(
|
const memoizeAction = useCallback(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue