Skip to content

Commit

Permalink
fix: add check to ensure page is loaded before updating view based on…
Browse files Browse the repository at this point in the history
… width
  • Loading branch information
clarkmcadoo committed Jan 7, 2022
1 parent 86ef387 commit f0ecb97
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/instant-observability.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f0ecb97

Please sign in to comment.