diff --git a/components/CharacterGrid/index.tsx b/components/CharacterGrid/index.tsx index 944f4e85..b97218da 100644 --- a/components/CharacterGrid/index.tsx +++ b/components/CharacterGrid/index.tsx @@ -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 diff --git a/components/JobSection/index.tsx b/components/JobSection/index.tsx index 96bc374b..f88a4016 100644 --- a/components/JobSection/index.tsx +++ b/components/JobSection/index.tsx @@ -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 diff --git a/components/SummonGrid/index.tsx b/components/SummonGrid/index.tsx index 511befcc..1263658b 100644 --- a/components/SummonGrid/index.tsx +++ b/components/SummonGrid/index.tsx @@ -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<{ diff --git a/components/WeaponGrid/index.tsx b/components/WeaponGrid/index.tsx index ee73a003..4dbdc346 100644 --- a/components/WeaponGrid/index.tsx +++ b/components/WeaponGrid/index.tsx @@ -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 diff --git a/pages/new/index.tsx b/pages/new/index.tsx index a25d3f8f..e03a3cfa 100644 --- a/pages/new/index.tsx +++ b/pages/new/index.tsx @@ -65,14 +65,19 @@ const NewRoute: React.FC = ({ 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 }, [])