Skip to content

Commit

Permalink
feat: add local gateway bypass option
Browse files Browse the repository at this point in the history
  • Loading branch information
vaultec81 committed Jan 21, 2021
1 parent 03669c1 commit eebfce9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/renderer/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const Finder = ArraySearch.Finder;

const ipfs = {
gateway: "https://ipfs.3speak.co/ipfs/",
async getGateway(cid) {
async getGateway(cid, bypass) {
if(bypass === true) {
return ipfs.gateway;
}
var {ipfs:ipfsInstance} = await ipfsHandler.getIpfs();
var has = false;
try {
Expand Down Expand Up @@ -302,7 +305,7 @@ const video = {
if(thumbnailSource) {
try {
var cid = ipfs.urlToCID(thumbnailSource.url);
var gateway = await ipfs.getGateway(cid);
var gateway = await ipfs.getGateway(cid, true);
return gateway + ipfs.urlToIpfsPath(thumbnailSource.url);
} catch (ex) {
return `https://img.3speakcontent.co/${reflink.permlink}/thumbnail.png`
Expand Down

0 comments on commit eebfce9

Please sign in to comment.