band-aid fixes for the pull request and hopefully a strange ongoing issue
This commit is contained in:
parent
7895003b44
commit
8a75b46f51
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "skilldisplay",
|
"name": "skilldisplay",
|
||||||
"version": "0.1.1",
|
"version": "0.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "^16.8.6",
|
"react": "^16.8.6",
|
||||||
|
@ -45,21 +45,13 @@ export default function Action({ action_id }) {
|
|||||||
}
|
}
|
||||||
}, [action_id])
|
}, [action_id])
|
||||||
|
|
||||||
const isGCD = React.useMemo(
|
|
||||||
() =>
|
|
||||||
gcdOverrides.has(action_id) ||
|
|
||||||
!ogcdOverrides.has(action_id) ||
|
|
||||||
apiData !== undefined && apiData.ActionCategory.ID !== 4,
|
|
||||||
[action_id]
|
|
||||||
)
|
|
||||||
|
|
||||||
if (apiData === undefined || !apiData.Icon) {
|
if (apiData === undefined || !apiData.Icon) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
className={isGCD ? 'action-icon gcd' : 'action-icon ogcd'}
|
className={(gcdOverrides.has(action_id) || (!ogcdOverrides.has(action_id) && apiData.ActionCategory.ID !== 4)) ? 'action-icon gcd' : 'action-icon ogcd'}
|
||||||
src={`https://xivapi.com/${apiData.Icon}`}
|
src={`https://xivapi.com/${apiData.Icon}`}
|
||||||
alt={apiData.Name || ''}
|
alt={apiData.Name || ''}
|
||||||
/>
|
/>
|
||||||
|
@ -8,7 +8,8 @@ class App extends React.Component {
|
|||||||
me: 0,
|
me: 0,
|
||||||
actionlist: [],
|
actionlist: [],
|
||||||
actionindex: 1,
|
actionindex: 1,
|
||||||
lastAddedTimestamp: ''
|
lastAddedTimestamp: '',
|
||||||
|
lastAddedAction: -1,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -35,16 +36,17 @@ class App extends React.Component {
|
|||||||
|
|
||||||
if(action <= 8) return //things we don't care about i.e. sprint auto-attacks
|
if(action <= 8) return //things we don't care about i.e. sprint auto-attacks
|
||||||
|
|
||||||
if(this.state.lastAddedTimestamp === log[1]) return //no double aoe stuff
|
if(this.state.lastAddedTimestamp === log[1] && this.state.lastAddedAction === action) return //no double aoe stuff
|
||||||
|
|
||||||
const index = this.state.actionindex
|
const index = this.state.actionindex
|
||||||
|
|
||||||
this.setState((state) => {
|
this.setState((state) => {
|
||||||
const actionindex = (state.actionindex >= 32)?1:state.actionindex+1
|
const actionindex = (state.actionindex >= 32)?1:state.actionindex+1
|
||||||
const lastAddedTimestamp = log[1]
|
const lastAddedTimestamp = log[1]
|
||||||
|
const lastAddedAction = action
|
||||||
const actionlist = state.actionlist.concat({index,action});
|
const actionlist = state.actionlist.concat({index,action});
|
||||||
|
|
||||||
return {actionindex,lastAddedTimestamp,actionlist}
|
return {actionindex,lastAddedTimestamp,lastAddedAction,actionlist}
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(this.purgeAction.bind(this), 10000)
|
setTimeout(this.purgeAction.bind(this), 10000)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user