From dae06b90877027d0ebcbba2487f722a088f0ec7a Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 2 Jan 2023 02:03:58 -0800 Subject: [PATCH 1/4] Intermediate fix for CheckedState I don't really know how to handle this lol --- components/SearchFilterCheckboxItem/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/SearchFilterCheckboxItem/index.tsx b/components/SearchFilterCheckboxItem/index.tsx index 0c2111fd..073d7b51 100644 --- a/components/SearchFilterCheckboxItem/index.tsx +++ b/components/SearchFilterCheckboxItem/index.tsx @@ -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 ( From e0c809867ee5a824100ffec595b7b753cc5a0a3a Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 2 Jan 2023 02:04:08 -0800 Subject: [PATCH 2/4] Use string for visible --- components/AwakeningSelect/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/AwakeningSelect/index.tsx b/components/AwakeningSelect/index.tsx index 5d2fa958..349e7ae9 100644 --- a/components/AwakeningSelect/index.tsx +++ b/components/AwakeningSelect/index.tsx @@ -187,7 +187,7 @@ const AwakeningSelect = (props: Props) => { max={maxValue} step="1" onChange={handleInputChange} - visible={awakeningType !== -1} + visible={`${awakeningType !== -1}`} ref={awakeningLevelInput} /> From d3c2c6846b03cb89397b0206d2a6dabccf6c325c Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 2 Jan 2023 02:05:56 -0800 Subject: [PATCH 3/4] Add key to weapon series group elements --- components/WeaponSearchFilterBar/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/WeaponSearchFilterBar/index.tsx b/components/WeaponSearchFilterBar/index.tsx index cfa154f6..dd7fdba1 100644 --- a/components/WeaponSearchFilterBar/index.tsx +++ b/components/WeaponSearchFilterBar/index.tsx @@ -137,7 +137,7 @@ const WeaponSearchFilterBar = (props: Props) => { const renderWeaponSeriesGroup = (index: number) => { return ( - + {weaponSeries .slice( index * Math.ceil(weaponSeries.length / 3), From 3e328711075653a6dac65a57f4030cfe481f86e3 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 2 Jan 2023 02:08:01 -0800 Subject: [PATCH 4/4] Also prevent updating uncap stars on Character/Summon grids --- components/CharacterGrid/index.tsx | 13 ++++++++++--- components/SummonGrid/index.tsx | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/components/CharacterGrid/index.tsx b/components/CharacterGrid/index.tsx index cc76d550..916bc677 100644 --- a/components/CharacterGrid/index.tsx +++ b/components/CharacterGrid/index.tsx @@ -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( diff --git a/components/SummonGrid/index.tsx b/components/SummonGrid/index.tsx index d2092dfb..aba10c33 100644 --- a/components/SummonGrid/index.tsx +++ b/components/SummonGrid/index.tsx @@ -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(