Add status to appState and new types

This commit is contained in:
Justin Edmund 2023-01-28 16:46:32 -08:00
parent 7b06a2900e
commit 9476f592f0
2 changed files with 18 additions and 1 deletions

15
types/index.d.ts vendored
View file

@ -70,3 +70,18 @@ interface PerpetuityObject {
perpetuity: boolean
}
}
interface PageContextObj {
party?: Party
jobs: Job[]
jobSkills: JobSkill[]
raids: Raid[]
sortedRaids: Raid[][]
weaponKeys: GroupedWeaponKeys
meta: { [key: string]: string }
}
interface ResponseStatus {
code: number
text: string
}

View file

@ -1,5 +1,5 @@
import { proxy } from 'valtio'
import { JobSkillObject } from '~types'
import { JobSkillObject, ResponseStatus } from '~types'
import { GroupedWeaponKeys } from './groupWeaponKeys'
const emptyJob: Job = {
@ -86,6 +86,7 @@ interface AppState {
jobSkills: JobSkill[]
weaponKeys: GroupedWeaponKeys
version: AppUpdate
status?: ResponseStatus
}
export const initialAppState: AppState = {
@ -156,6 +157,7 @@ export const initialAppState: AppState = {
update_type: '',
updated_at: '',
},
status: undefined,
}
export const appState = proxy(initialAppState)