Merge pull request #109 from jedmund/fix-build

Fix various issues - UncapStars, Radix update changes, React key warnings
This commit is contained in:
Justin Edmund 2023-01-02 02:09:39 -08:00 committed by GitHub
commit 485a56b131
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 10 deletions

View file

@ -187,7 +187,7 @@ const AwakeningSelect = (props: Props) => {
max={maxValue}
step="1"
onChange={handleInputChange}
visible={awakeningType !== -1}
visible={`${awakeningType !== -1}`}
ref={awakeningLevelInput}
/>
</div>

View file

@ -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(

View file

@ -13,8 +13,12 @@ interface Props {
}
const SearchFilterCheckboxItem = (props: Props) => {
function handleCheckedChange(checked: boolean) {
props.onCheckedChange(checked, props.valueKey)
function handleCheckedChange(checked: string | boolean) {
if (typeof checked === 'boolean') {
props.onCheckedChange(checked, props.valueKey)
} else {
props.onCheckedChange(false, props.valueKey)
}
}
return (

View file

@ -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(

View file

@ -137,7 +137,7 @@ const WeaponSearchFilterBar = (props: Props) => {
const renderWeaponSeriesGroup = (index: number) => {
return (
<DropdownMenu.Group className="Group">
<DropdownMenu.Group className="Group" key={`Group-${index}`}>
{weaponSeries
.slice(
index * Math.ceil(weaponSeries.length / 3),