Also prevent updating uncap stars on Character/Summon grids
This commit is contained in:
parent
d3c2c6846b
commit
3e32871107
2 changed files with 20 additions and 6 deletions
|
|
@ -15,6 +15,7 @@ import type { JobSkillObject, SearchableObject } from '~types'
|
|||
|
||||
import api from '~utils/api'
|
||||
import { appState } from '~utils/appState'
|
||||
import { accountState } from '~utils/accountState'
|
||||
|
||||
import './index.scss'
|
||||
|
||||
|
|
@ -283,10 +284,16 @@ const CharacterGrid = (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(
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import ExtraSummons from '~components/ExtraSummons'
|
|||
|
||||
import api from '~utils/api'
|
||||
import { appState } from '~utils/appState'
|
||||
import { accountState } from '~utils/accountState'
|
||||
import type { SearchableObject } from '~types'
|
||||
|
||||
import './index.scss'
|
||||
|
|
@ -156,10 +157,16 @@ const SummonGrid = (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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue