diff --git a/components/CharacterGrid/index.tsx b/components/CharacterGrid/index.tsx index 4a1eb463..c855c206 100644 --- a/components/CharacterGrid/index.tsx +++ b/components/CharacterGrid/index.tsx @@ -71,9 +71,10 @@ const CharacterGrid = (props: Props) => { const partyUser = (party.user_id) ? party.user_id : undefined const loggedInUser = (cookies.user) ? cookies.user.user_id : '' - if (partyUser != undefined && loggedInUser != undefined && partyUser === loggedInUser) { - party.editable = true - } + if (partyUser != undefined && loggedInUser != undefined && partyUser === loggedInUser) + appState.party.editable = true + else + appState.party.editable = false // Store the important party and state-keeping values appState.party.id = party.id @@ -120,9 +121,10 @@ const CharacterGrid = (props: Props) => { .catch(error => console.error(error)) }) } else { - saveCharacter(party.id, character, position) - .then(response => storeGridCharacter(response.data.grid_character)) - .catch(error => console.error(error)) + if (party.editable) + saveCharacter(party.id, character, position) + .then(response => storeGridCharacter(response.data.grid_character)) + .catch(error => console.error(error)) } } diff --git a/components/CharacterUnit/index.tsx b/components/CharacterUnit/index.tsx index 945c1e30..761d4af7 100644 --- a/components/CharacterUnit/index.tsx +++ b/components/CharacterUnit/index.tsx @@ -6,6 +6,7 @@ import UncapIndicator from '~components/UncapIndicator' import PlusIcon from '~public/icons/Add.svg' import './index.scss' +import { omit } from 'lodash' interface Props { gridCharacter: GridCharacter | undefined @@ -47,20 +48,27 @@ const CharacterUnit = (props: Props) => { props.updateUncap(props.gridCharacter.id, props.position, uncap) } + const image = ( +