Skip to content

Add support for StoryShots#479

Merged
arunoda merged 1 commit intomasterfrom
check-if-storyshots
Sep 22, 2016
Merged

Add support for StoryShots#479
arunoda merged 1 commit intomasterfrom
check-if-storyshots

Conversation

@roonyh
Copy link
Copy Markdown
Contributor

@roonyh roonyh commented Sep 22, 2016

storyshots adds polyfills for window. So preview will incorrectly assume we’re on a browser. This will avoid that.

Comment thread src/client/preview/index.js Outdated
// check whether we're running on node/browser
const isBrowser = typeof window !== 'undefined';
// storyshots got polyfills for window so need to make sure its not storyshots
const isBrowser = typeof window !== 'undefined' && !isStoryShots;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this:

const { navigator } = global;
const isBrowser = navigator && navigator. userAgent !== 'storyshots';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arunoda yeah. updated.

@roonyh roonyh force-pushed the check-if-storyshots branch from fba3a84 to bb7cb66 Compare September 22, 2016 10:01
storyshots adds polyfills for window. So preview will incorrectly assume we’re on a browser. This will avoid that.
@roonyh roonyh force-pushed the check-if-storyshots branch from bb7cb66 to 6309b54 Compare September 22, 2016 10:04
@arunoda arunoda merged commit 4c7ada5 into master Sep 22, 2016
@arunoda arunoda deleted the check-if-storyshots branch September 22, 2016 10:06
@arunoda arunoda changed the title Check if we are on storyshots in preview Add support for StoryShots Sep 22, 2016
@shilman shilman added the misc label May 27, 2017
@ghost ghost mentioned this pull request Apr 16, 2018
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Jan 30, 2025

View your CI Pipeline Execution ↗ for commit 6309b54

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 53s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-30 16:01:27 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants