Skip to content

Commit

Permalink
Merge pull request #52 from storybookjs/misc-fixes
Browse files Browse the repository at this point in the history
Improve story detection
  • Loading branch information
yannbf authored Jun 14, 2023
2 parents e0350d8 + 939beb1 commit bc0de14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/features/WriteStoriesModal/WriteStoriesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const WriteStoriesModal: FC<WriteStoriesModalProps> = ({
: dataTypescript;

const copyWarningStory = () => {
const warningContent = data[4][0].code;
const warningContent = data[3][0].code;
navigator.clipboard.writeText(
warningContent.replace("// Copy the code below", "")
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export const useGetWarningButtonStatus = (

if (out) {
setStatus({ data: true, error: null });
} else {
setStatus({ data: false, error: null });
}
});
};
Expand All @@ -29,6 +31,7 @@ export const useGetWarningButtonStatus = (
if(api.getData("example-button--warning")) {
setStatus({ data: true, error: null });
} else {
// This should probably be changed to getChannel but we'll keep for backwards compatibility in case people end up using this addon with Storybook 7.0.0 and not 7.1.0
addonsStore
.getServerChannel()
.on(STORY_INDEX_INVALIDATED, getWarningButtonStatus);
Expand Down

0 comments on commit bc0de14

Please sign in to comment.