Render the first story for a kind if no story selected.

For #674
This commit is contained in:
Tom Coleman 2017-04-19 22:49:25 +10:00
parent 53f5f01f1d
commit 0455ab5cc9
2 changed files with 2 additions and 1 deletions

View File

@ -43,6 +43,7 @@ export function ensureStory(storyKinds, selectedKind, selectedStory) {
const found = kindInfo.stories.find(item => item === selectedStory);
if (found) return found;
// if the selected story is non-existant, select the first story
return kindInfo.stories[0];
}

View File

@ -58,7 +58,7 @@ export function updateStore(queryParams, actions) {
...customQueryParams
} = queryParams;
if (selectedKind && selectedStory) {
if (selectedKind) {
actions.api.selectStory(selectedKind, selectedStory);
}