From f0ecb9771b94ddb3af85dc9251253245acc43601 Mon Sep 17 00:00:00 2001 From: Clark McAdoo Date: Fri, 7 Jan 2022 16:19:13 -0600 Subject: [PATCH] fix: add check to ensure page is loaded before updating view based on width --- src/pages/instant-observability.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/instant-observability.js b/src/pages/instant-observability.js index 74ffe2a13..4a713a204 100644 --- a/src/pages/instant-observability.js +++ b/src/pages/instant-observability.js @@ -96,9 +96,11 @@ const QuickstartsPage = ({ data, location }) => { const categoryParam = params.get('category'); // Forcing view to List View if device is < 1080px. - const width = window.innerWidth; - if (width < LISTVIEW_BREAKPOINT) { - setView(VIEWS.LIST); + if (typeof window !== 'undefined') { + const width = window.innerWidth; + if (width < LISTVIEW_BREAKPOINT) { + setView(VIEWS.LIST); + } } setSearch(searchParam);