Skip to content

Commit

Permalink
Check if we are on storyshots in preview (#479)
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 authored and arunoda committed Sep 22, 2016
1 parent e532b4e commit 4c7ada5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ 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 4c7ada5

Please sign in to comment.