mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-01-26 15:04:19 +01:00
use a regex (based on the current multihash) to detect a gateway
This commit is contained in:
parent
aecf89339c
commit
ce78207546
@ -11,7 +11,9 @@ var Updater = React.createClass({
|
|||||||
},
|
},
|
||||||
checkForUpdates () {
|
checkForUpdates () {
|
||||||
var v = window.location.pathname
|
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) {
|
if (v !== '/ipns/boards.ydns.eu/' || !gateway) {
|
||||||
this.setState({ update: true })
|
this.setState({ update: true })
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user