Merge pull request #194 from jedmund/fix-191

Fix job dropdown not showing entries
This commit is contained in:
Justin Edmund 2023-01-29 16:22:28 -08:00 committed by GitHub
commit e96c3e7fb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 9 deletions

View file

@ -47,7 +47,6 @@ const CharacterGrid = (props: Props) => {
// Set up state for view management
const { party, grid } = useSnapshot(appState)
const [slug, setSlug] = useState()
const [modalOpen, setModalOpen] = useState(false)
// Set up state for conflict management

View file

@ -10,7 +10,6 @@ import SearchModal from '~components/SearchModal'
import api from '~utils/api'
import { appState } from '~utils/appState'
import { ACCESSORY_JOB_IDS } from '~utils/jobsWithAccessories'
import type { JobSkillObject, SearchableObject } from '~types'
import './index.scss'
@ -115,7 +114,7 @@ const JobSection = (props: Props) => {
const canEditSkill = (skill?: JobSkill) => {
// If there is a job and a skill present in the slot
if (job) {
if (job && job.id !== '-1') {
// If the skill's job is one of the job's main skill
if (skill && skill.job.id === job.id && skill.main) return false

View file

@ -45,7 +45,6 @@ const SummonGrid = (props: Props) => {
// Set up state for view management
const { party, grid } = useSnapshot(appState)
const [slug, setSlug] = useState()
// Create a temporary state to store previous weapon uncap values and transcendence stages
const [previousUncapValues, setPreviousUncapValues] = useState<{

View file

@ -48,7 +48,6 @@ const WeaponGrid = (props: Props) => {
// Set up state for view management
const { party, grid } = useSnapshot(appState)
const [slug, setSlug] = useState()
const [modalOpen, setModalOpen] = useState(false)
// Set up state for conflict management

View file

@ -65,14 +65,19 @@ const NewRoute: React.FC<Props> = ({
appState.weaponKeys = context.weaponKeys
}
appState.version = version
}, [])
}, [context, version])
useEffect(() => {
// Clean state
const resetState = clonedeep(initialAppState)
Object.keys(resetState).forEach((key) => {
appState[key] = resetState[key]
})
appState.party = resetState.party
appState.grid = resetState.grid
// Old method kept in case we need it later
// Object.keys(resetState).forEach((key) => {
// appState[key] = resetState[key]
// })
// Set party to be editable
appState.party.editable = true
}, [])