Remember equipment drawer tab (#10458)

* Remember equipment drawer tab

* Split local setting value constants
This commit is contained in:
Dexx Mandele
2018-06-27 19:08:21 +02:00
committed by Matteo Pagliazzi
parent d549fea4ed
commit c91da86b89
3 changed files with 38 additions and 20 deletions

View File

@@ -190,7 +190,7 @@ export default {
mounted () {
// @TODO: should we abstract the drawer state/local store to a library and mixing combo? We use a similar pattern in equipment
const spellDrawerState = getLocalSetting(CONSTANTS.keyConstants.SPELL_DRAWER_STATE);
if (spellDrawerState === CONSTANTS.valueConstants.DRAWER_CLOSED) {
if (spellDrawerState === CONSTANTS.drawerStateValues.DRAWER_CLOSED) {
this.$store.state.spellOptions.spellDrawOpen = false;
}
},
@@ -205,11 +205,11 @@ export default {
this.$store.state.spellOptions.spellDrawOpen = newState;
if (newState) {
setLocalSetting(CONSTANTS.keyConstants.SPELL_DRAWER_STATE, CONSTANTS.valueConstants.DRAWER_OPEN);
setLocalSetting(CONSTANTS.keyConstants.SPELL_DRAWER_STATE, CONSTANTS.drawerStateValues.DRAWER_OPEN);
return;
}
setLocalSetting(CONSTANTS.keyConstants.SPELL_DRAWER_STATE, CONSTANTS.valueConstants.DRAWER_CLOSED);
setLocalSetting(CONSTANTS.keyConstants.SPELL_DRAWER_STATE, CONSTANTS.drawerStateValues.DRAWER_CLOSED);
},
spellDisabled (skill) {
if (skill === 'frost' && this.user.stats.buffs.streaks) {