diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8442f310..6e0566de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ env: REACT_APP_INFURA_TOKEN: ${{ secrets.REACT_APP_INFURA_TOKEN }} REACT_APP_PORTIS_ID: ${{ secrets.REACT_APP_PORTIS_ID }} REACT_APP_GNOSIS_APPS_URL: ${{ secrets.REACT_APP_GNOSIS_APPS_URL }} - + REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }} jobs: release: runs-on: ${{ matrix.os }} @@ -28,13 +28,13 @@ jobs: steps: - name: Check out Git repository uses: actions/checkout@v2 - + - name: Patch node gyp on windows to support Visual Studio 2019 if: startsWith(matrix.os, 'windows') shell: powershell run: | yarn global add --production windows-build-tools --vs2015 --msvs_version=2015 - + - name: Install node-gyp if: startsWith(matrix.os, 'windows') shell: powershell diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 9d3f67c5..cae3bcff 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -52,7 +52,7 @@ function ensureSlash(path, needsSlash) { // single-page apps that may serve index.html for nested URLs like /todos/42. // We can't use a relative path in HTML because we don't want to load something // like /todos/42/static/js/bundle.7289d.js. We have to know the root. -const buildDesktop = process.env.BUILD_FOR_DESKTOP +const buildDesktop = process.env.REACT_APP_BUILD_FOR_DESKTOP const homepagePath = require(paths.appPackageJson).homepage // var homepagePathname = homepagePath ? url.parse(homepagePath).pathname : '/'; diff --git a/package.json b/package.json index e9d61593..7cdc54ab 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "electron-dev": "concurrently \"BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\"", "preelectron-pack": "yarn build", "build-mainnet": "cross-env REACT_APP_NETWORK=mainnet yarn build", - "build-desktop": "cross-env BUILD_FOR_DESKTOP=true yarn build-mainnet", + "build-desktop": "cross-env REACT_APP_BUILD_FOR_DESKTOP=true yarn build-mainnet", "flow": "flow", "format:staged": "lint-staged", "lint:check": "eslint './src/**/*.{js,jsx}'", diff --git a/src/components/CookiesBanner/index.jsx b/src/components/CookiesBanner/index.jsx index b8dcd88e..6b1edba3 100644 --- a/src/components/CookiesBanner/index.jsx +++ b/src/components/CookiesBanner/index.jsx @@ -17,6 +17,8 @@ import { mainFontFamily, md, primary, screenSm } from '~/theme/variables' import { loadGoogleAnalytics } from '~/utils/googleAnalytics' import { loadIntercom } from '~/utils/intercom' +const isDesktop = process.env.REACT_APP_BUILD_FOR_DESKTOP + const useStyles = makeStyles({ container: { backgroundColor: '#fff', @@ -111,14 +113,18 @@ const CookiesBanner = () => { fetchCookiesFromStorage() }, [showBanner]) + useEffect(() => { + if (isDesktop && showBanner) acceptCookiesHandler() + }, [isDesktop, showBanner]) + const acceptCookiesHandler = async () => { const newState = { acceptedNecessary: true, - acceptedAnalytics: true, + acceptedAnalytics: !isDesktop, } await saveCookie(COOKIES_KEY, newState, 365) dispatch(openCookieBanner(false)) - setShowAnalytics(true) + setShowAnalytics(!isDesktop) } const closeCookiesBannerHandler = async () => { @@ -193,8 +199,9 @@ const CookiesBanner = () => { loadIntercom() loadGoogleAnalytics() } + if (isDesktop) loadIntercom() - return showBanner ? cookieBannerContent : null + return showBanner && !isDesktop ? cookieBannerContent : null } export default CookiesBanner