From 77db31e5254d05bf65e06de8dd777c0712ac8f02 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Mon, 19 Aug 2019 03:59:08 -0400 Subject: [PATCH] fix:(graphiql) - for SSR, regression from extraKeys bugfix, fixes #942 - dont expect window to be present for extraKeys MacOs detection logic - use existing graphiql convention for detecting the presence of window --- packages/graphiql/src/utility/commonKeys.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/graphiql/src/utility/commonKeys.js b/packages/graphiql/src/utility/commonKeys.js index e05cdb42e83..f1557b85746 100644 --- a/packages/graphiql/src/utility/commonKeys.js +++ b/packages/graphiql/src/utility/commonKeys.js @@ -1,4 +1,8 @@ -const isMacOs = window.navigator.platform === 'MacIntel'; +let isMacOs = false + +if (typeof window === Object) { + isMacOs = window.navigator.platform === 'MacIntel'; +} const commonKeys = { // Persistent search box in Query Editor