Merge pull request #18916 from storybookjs/fix/set-project-annotations

Store: always call composeConfigs in setProjectAnnotations
This commit is contained in:
Yann Braga 2022-08-11 15:38:15 +02:00 committed by GitHub
commit 30df6a2da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,9 +27,8 @@ let GLOBAL_STORYBOOK_PROJECT_ANNOTATIONS = {};
export function setProjectAnnotations<TFramework extends AnyFramework = AnyFramework>(
projectAnnotations: ProjectAnnotations<TFramework> | ProjectAnnotations<TFramework>[]
) {
GLOBAL_STORYBOOK_PROJECT_ANNOTATIONS = Array.isArray(projectAnnotations)
? composeConfigs(projectAnnotations)
: projectAnnotations;
const annotations = Array.isArray(projectAnnotations) ? projectAnnotations : [projectAnnotations];
GLOBAL_STORYBOOK_PROJECT_ANNOTATIONS = composeConfigs(annotations);
}
interface ComposeStory<TFramework extends AnyFramework = AnyFramework, TArgs extends Args = Args> {