diff --git a/src/Apps/Artwork/artworkRoutes.tsx b/src/Apps/Artwork/artworkRoutes.tsx index 9eae5861c67..9264b89137d 100644 --- a/src/Apps/Artwork/artworkRoutes.tsx +++ b/src/Apps/Artwork/artworkRoutes.tsx @@ -2,6 +2,7 @@ import loadable from "@loadable/component" import { graphql } from "react-relay" import { updateContext } from "Server/middleware/bootstrapSharifyAndContextLocalsMiddleware" import { RouteProps } from "System/Router/Route" +import { getENV } from "Utils/getENV" const ArtworkApp = loadable( () => import(/* webpackChunkName: "artworkBundle" */ "./ArtworkApp"), @@ -18,9 +19,9 @@ export const artworkRoutes: RouteProps[] = [ onClientSideRender: () => { ArtworkApp.preload() }, - prepareVariables: ({ artworkID }, { context }) => { + prepareVariables: ({ artworkID }) => { // We want to defer loading the sidebar for mobile as it is below-the-fold. - const loadSidebar = !context?.isMobile + const loadSidebar = !getENV("IS_MOBILE") return { artworkID, diff --git a/src/System/Router/Utils/serverAppContext.ts b/src/System/Router/Utils/serverAppContext.ts index 2a89d4d4471..ce474fcf8db 100644 --- a/src/System/Router/Utils/serverAppContext.ts +++ b/src/System/Router/Utils/serverAppContext.ts @@ -12,7 +12,6 @@ export const getServerAppContext = ( initialMatchingMediaQueries: res.locals.sd.IS_MOBILE ? ["xs"] : undefined, user: req.user, isEigen: req.header("User-Agent")?.match("Artsy-Mobile") != null, - isMobile: res.locals.sd.IS_MOBILE, featureFlags: res.locals.sd.FEATURE_FLAGS, userPreferences: res.locals.sd.USER_PREFERENCES, ...context, diff --git a/src/System/Router/__tests__/serverRouter.jest.enzyme.tsx b/src/System/Router/__tests__/serverRouter.jest.enzyme.tsx index a17db2fec59..f74c91bbeaf 100644 --- a/src/System/Router/__tests__/serverRouter.jest.enzyme.tsx +++ b/src/System/Router/__tests__/serverRouter.jest.enzyme.tsx @@ -179,7 +179,6 @@ describe("serverRouter", () => { "initialMatchingMediaQueries", "isEigen", "isLoggedIn", - "isMobile", "relayEnvironment", "router", "routes",