fix: 🐛 Fix for JS breaking on header (#1164)

This commit is contained in:
ladeirarodolfo 2019-11-12 09:13:59 -03:00 committed by Danny Brown
parent a2a7e05e7d
commit 0fbaf95971

View File

@ -3,11 +3,14 @@ import { connect } from 'react-redux';
import { hotkeysManager } from '../App.js';
const mapStateToProps = state => {
const hotkeyDefinitions =
state.preferences.hotkeyDefinitions.length > 0
? state.preferences.hotkeyDefinitions
const { hotkeyDefinitions = [] } = state.preferences || {};
const _hotkeyDefinitions =
hotkeyDefinitions.length > 0
? hotkeyDefinitions
: hotkeysManager.hotkeyDefaults;
hotkeysManager.setHotkeys(hotkeyDefinitions);
hotkeysManager.setHotkeys(_hotkeyDefinitions);
return {
user: state.oidc && state.oidc.user,