From 6489d0547f5622d8c3c0c650515a7b9de8095902 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Sat, 2 Mar 2019 18:24:05 +0100 Subject: [PATCH] CLEANUP --- lib/ui/src/core/addons.js | 6 +----- lib/ui/src/core/shortcuts.js | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/ui/src/core/addons.js b/lib/ui/src/core/addons.js index b34d1314230c..7ebc7cc5ac4a 100644 --- a/lib/ui/src/core/addons.js +++ b/lib/ui/src/core/addons.js @@ -29,11 +29,7 @@ export default ({ provider, store }) => { return { api, state: { - selectedPanel: ensurePanel( - api.getPanels(), - store.getState().selectedPanel, - store.getState().selectedPanel - ), + selectedPanel: ensurePanel(api.getPanels(), store.getState().selectedPanel), }, }; }; diff --git a/lib/ui/src/core/shortcuts.js b/lib/ui/src/core/shortcuts.js index 3cdab8d48107..9c07925da757 100644 --- a/lib/ui/src/core/shortcuts.js +++ b/lib/ui/src/core/shortcuts.js @@ -1,7 +1,6 @@ import { navigator, document } from 'global'; import { PREVIEW_KEYDOWN } from '@storybook/core-events'; -import getInitialState from './initial-state'; import { shortcutMatchesShortcut, eventToShortcut } from '../libs/shortcut'; export const isMacLike = () => @@ -32,7 +31,7 @@ export default function initShortcuts({ store }) { const api = { // Getting and setting shortcuts getShortcutKeys() { - return store.getState().shortcuts || getInitialState().shortcuts; + return store.getState().shortcuts; }, async setShortcuts(shortcuts) { await store.setState({ shortcuts }, { persistence: 'permanent' });