Skip to content

Commit 86a2263

Browse files
committed
window is not defined fix
1 parent 504d994 commit 86a2263

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shared/utils/contentful.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export function fixStyle(style) {
1212
const props = _.omitBy(style, !_.isObject);
1313
const mediaQueries = _.pickBy(
1414
style,
15-
(propVal, mQuery) => _.isObject(propVal) && window.matchMedia(mQuery).matches,
15+
(propVal, mQuery) => _.isObject(propVal)
16+
&& isomorphy.isClientSide() && window.matchMedia(mQuery).matches,
1617
);
1718
const merged = _.merge(props, ..._.values(mediaQueries));
1819
return merged ? _.mapKeys(merged, (value, key) => _.camelCase(key)) : undefined;

0 commit comments

Comments
 (0)