Core: Fix showRoots behavior when there's no hierarchy

This commit is contained in:
Michael Shilman 2019-11-13 18:06:12 +08:00
parent 70997af8ec
commit 529b8470e5

View File

@ -243,7 +243,7 @@ const initStoriesApi = ({
// 3. If the user passes showRoots, or doesn't match above, do a simpler splitting.
} else {
const parts: string[] = kind.split('/');
if (showRoots) {
if (showRoots && parts.length > 1) {
[root, ...groups] = parts;
} else {
groups = parts;