Skip to content

Commit

Permalink
Check if we are on storyshots in preview
Browse files Browse the repository at this point in the history
storyshots adds polyfills for window. So preview will incorrectly assume we’re on a browser. This will avoid that.
  • Loading branch information
roonyh committed Sep 22, 2016
1 parent e532b4e commit bb7cb66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import init from './init';
import { selectStory } from './actions';
import reducer from './reducer';

// check whether we're running on node/browser
const isBrowser = typeof window !== 'undefined';
const { navigator } = global;
const isBrowser = navigator && navigator. userAgent !== 'storyshots';

const storyStore = new StoryStore();
const reduxStore = createStore(reducer);
Expand Down

0 comments on commit bb7cb66

Please sign in to comment.