Skip to content

Commit

Permalink
fix: provide args values from url to control
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlo Zhukov committed Oct 27, 2021
1 parent e260ec5 commit 4fb913d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/preview-web/src/PreviewWeb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,17 @@ export class PreviewWeb<TFramework extends AnyFramework> {
unboundStoryFn,
};

// Populate args from url to ArgsTable controls.
if (initial) {
const { args, storySpecifier } = this.urlStore.selectionSpecifier;
if (Object.keys(args).length > 0) {
this.channel.emit(Events.STORY_ARGS_UPDATED, {
storyId: storySpecifier,
updatedArgs: args,
});
}
}

try {
if (!this.renderToDOM) {
throw new Error(dedent`
Expand Down

0 comments on commit 4fb913d

Please sign in to comment.