From ce78207546a860cd7f7b93efddbdbba56dcd5bea Mon Sep 17 00:00:00 2001 From: Mithgol the Webmaster Date: Sun, 24 Jan 2016 16:51:58 +0300 Subject: [PATCH] =?UTF-8?q?use=20a=C2=A0regex=20(based=C2=A0on=C2=A0the?= =?UTF-8?q?=C2=A0current=20multihash)=20to=C2=A0detect=20a=C2=A0gateway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/components/navbar.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index b0e1e2a..a803930 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -11,7 +11,9 @@ var Updater = React.createClass({ }, checkForUpdates () { var v = window.location.pathname - var gateway = window.location.pathname.indexOf('/ipfs/') === 0 || window.location.pathname.indexOf('/ipns/') === 0 + var gateway = /^\/ip[fn]s\/Qm[1-9A-HJ-NP-Za-km-z]{44}/.test( + window.location.pathname + ) if (v !== '/ipns/boards.ydns.eu/' || !gateway) { this.setState({ update: true }) }