From 81822e6114cf67d8601cbcdec2e60571a21127aa Mon Sep 17 00:00:00 2001 From: Rafael Ugolini Date: Fri, 19 May 2023 15:52:34 +0200 Subject: [PATCH 1/4] fix: remove double IPFS and pull the logic to env variables --- dapp/src/components/IPFSDappLink.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dapp/src/components/IPFSDappLink.js b/dapp/src/components/IPFSDappLink.js index c2f7642cce..4549b1c4e4 100644 --- a/dapp/src/components/IPFSDappLink.js +++ b/dapp/src/components/IPFSDappLink.js @@ -7,9 +7,7 @@ export default function IPFSDappLink({ css }) { useEffect(() => { setDisplayIpfsLink( - ['app.ousd.com'].includes(window.location.host) || - window.location.host.startsWith('localhost:') || - window.location.host.startsWith('ousd-staging') + process.env.DEPLOY_MODE !== 'ipfs' ) }, []) From 0f83103908b3d061866440dbe780bfc67b0c9c62 Mon Sep 17 00:00:00 2001 From: Rafael Ugolini Date: Fri, 19 May 2023 16:46:26 +0200 Subject: [PATCH 2/4] Revert "fix: remove double IPFS and pull the logic to env variables" This reverts commit 81822e6114cf67d8601cbcdec2e60571a21127aa. --- dapp/src/components/IPFSDappLink.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dapp/src/components/IPFSDappLink.js b/dapp/src/components/IPFSDappLink.js index 4549b1c4e4..c2f7642cce 100644 --- a/dapp/src/components/IPFSDappLink.js +++ b/dapp/src/components/IPFSDappLink.js @@ -7,7 +7,9 @@ export default function IPFSDappLink({ css }) { useEffect(() => { setDisplayIpfsLink( - process.env.DEPLOY_MODE !== 'ipfs' + ['app.ousd.com'].includes(window.location.host) || + window.location.host.startsWith('localhost:') || + window.location.host.startsWith('ousd-staging') ) }, []) From 8ced79ac38bd1af3b7f278fc623635e9f138c9fb Mon Sep 17 00:00:00 2001 From: Rafael Ugolini Date: Fri, 19 May 2023 16:49:07 +0200 Subject: [PATCH 3/4] fix: remove IPFS link if deploy mode is IPFS --- dapp-oeth/src/components/IPFSDappLink.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dapp-oeth/src/components/IPFSDappLink.js b/dapp-oeth/src/components/IPFSDappLink.js index a3510b4ed6..a57f2207eb 100644 --- a/dapp-oeth/src/components/IPFSDappLink.js +++ b/dapp-oeth/src/components/IPFSDappLink.js @@ -1,22 +1,21 @@ import React, { useEffect, useState } from 'react' import { fbt } from 'fbt-runtime' -import { assetRootPath } from 'utils/image' export default function IPFSDappLink({ css }) { const [displayIpfsLink, setDisplayIpfsLink] = useState(false) useEffect(() => { setDisplayIpfsLink( - ['app.oeth.com', 'staging.app.oeth.com'].includes(window.location.host) || - window.location.host.startsWith('localhost:') || - window.location.host.startsWith('oeth-dapp-staging') || - window.location.host.endsWith('.on.fleek.co') || - window.location.host.startsWith('oeth-dapp') + process.env.DEPLOY_MODE !== 'ipfs' ) }, []) + if (!displayIpfsLink) { + return null; + } + return ( -
+
Date: Fri, 19 May 2023 17:36:55 +0200 Subject: [PATCH 4/4] refactor: clean up --- dapp-oeth/src/components/IPFSDappLink.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dapp-oeth/src/components/IPFSDappLink.js b/dapp-oeth/src/components/IPFSDappLink.js index a57f2207eb..4fa04fa087 100644 --- a/dapp-oeth/src/components/IPFSDappLink.js +++ b/dapp-oeth/src/components/IPFSDappLink.js @@ -15,7 +15,7 @@ export default function IPFSDappLink({ css }) { } return ( -
+