Browse Source

fix(core): fix nullable control in the config state

pull/2613/head
mehmet-erim 7 years ago
parent
commit
756e8588f3
  1. 3
      npm/ng-packs/packages/core/src/lib/states/config.state.ts

3
npm/ng-packs/packages/core/src/lib/states/config.state.ts

@ -137,6 +137,7 @@ export class ConfigState {
key: string | Config.LocalizationWithDefault, key: string | Config.LocalizationWithDefault,
...interpolateParams: string[] ...interpolateParams: string[]
) { ) {
if (!key) key = '';
let defaultValue: string; let defaultValue: string;
if (typeof key !== 'string') { if (typeof key !== 'string') {
@ -144,8 +145,6 @@ export class ConfigState {
key = key.key; key = key.key;
} }
if (!key) key = '';
const keys = key.split('::') as string[]; const keys = key.split('::') as string[];
const selector = createSelector([ConfigState], (state: Config.State) => { const selector = createSelector([ConfigState], (state: Config.State) => {
if (!state.localization) return defaultValue || key; if (!state.localization) return defaultValue || key;

Loading…
Cancel
Save