mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
* Saved sort selection into local storage for later use * Updated code to use userLocalManager module
32 lines
742 B
JavaScript
32 lines
742 B
JavaScript
// @TODO: This might become too generic. If so, check the refactor docs
|
|
const CONSTANTS = {
|
|
keyConstants: {
|
|
SPELL_DRAWER_STATE: 'spell-drawer-state',
|
|
EQUIPMENT_DRAWER_STATE: 'equipment-drawer-state',
|
|
CURRENT_EQUIPMENT_DRAWER_TAB: 'current-equipment-drawer-tab',
|
|
STABLE_SORT_STATE: 'stable-sort-state',
|
|
},
|
|
drawerStateValues: {
|
|
DRAWER_CLOSED: 'drawer-closed',
|
|
DRAWER_OPEN: 'drawer-open',
|
|
},
|
|
equipmentDrawerTabValues: {
|
|
COSTUME_TAB: 'costume-tab',
|
|
EQUIPMENT_TAB: 'equipment-tab',
|
|
},
|
|
};
|
|
|
|
function setLocalSetting (key, value) {
|
|
localStorage.setItem(key, value);
|
|
}
|
|
|
|
function getLocalSetting (key) {
|
|
return localStorage.getItem(key);
|
|
}
|
|
|
|
export {
|
|
CONSTANTS,
|
|
getLocalSetting,
|
|
setLocalSetting,
|
|
};
|