Merge pull request #317 from cassidypignatello/fix/code-style-errors
fixes eslint errors
This commit is contained in:
commit
dc54ce1cf0
4 changed files with 19 additions and 27 deletions
|
@ -85,7 +85,6 @@ function syncWithApi(data) { // eslint-disable-line no-unused-vars
|
||||||
console.info(data); // eslint-disable-line no-console
|
console.info(data); // eslint-disable-line no-console
|
||||||
document.querySelector("developer-program").innerHTML =
|
document.querySelector("developer-program").innerHTML =
|
||||||
"<p><strong>No success or error was received so the LBRY API might be down.<br/>Please try again later.</strong></p>";
|
"<p><strong>No success or error was received so the LBRY API might be down.<br/>Please try again later.</strong></p>";
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
|
@ -200,7 +200,7 @@ export default async(data, socket) => {
|
||||||
apiRequestMethod = "GET";
|
apiRequestMethod = "GET";
|
||||||
body.uri = claimAddress;
|
body.uri = claimAddress;
|
||||||
try {
|
try {
|
||||||
let resolveResponse = await lbrytvAPI.resolve([claimAddress]);
|
const resolveResponse = await lbrytvAPI.resolve([claimAddress]);
|
||||||
|
|
||||||
if (socket) {
|
if (socket) {
|
||||||
const renderedCode = prism.highlight(
|
const renderedCode = prism.highlight(
|
||||||
|
|
|
@ -1,20 +1,16 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
import messageSlack from "./slack";
|
||||||
const request = require("request");
|
const request = require("request");
|
||||||
|
|
||||||
import messageSlack from "./slack";
|
|
||||||
|
|
||||||
|
|
||||||
let addSupport = function() {
|
const addSupport = function() {};
|
||||||
return;
|
|
||||||
};
|
|
||||||
|
|
||||||
let publish = function() {
|
const publish = function() {};
|
||||||
return;
|
|
||||||
};
|
|
||||||
|
|
||||||
let resolve = function(urls) {
|
const resolve = function(urls) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
let options = {
|
const options = {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "https://api.lbry.tv/api/v1/proxy",
|
url: "https://api.lbry.tv/api/v1/proxy",
|
||||||
headers:
|
headers:
|
||||||
|
@ -34,7 +30,7 @@ let resolve = function(urls) {
|
||||||
message: "```" + error + "```",
|
message: "```" + error + "```",
|
||||||
title: "DAEMON ERROR: resolve"
|
title: "DAEMON ERROR: resolve"
|
||||||
});
|
});
|
||||||
return reject("DAEMON ERROR: resolve");
|
return reject(new Error("DAEMON ERROR: resolve"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.prototype.hasOwnProperty.call(daemonResponse, "error")) {
|
if (Object.prototype.hasOwnProperty.call(daemonResponse, "error")) {
|
||||||
|
@ -42,17 +38,16 @@ let resolve = function(urls) {
|
||||||
message: "```" + daemonResponse.error + "```",
|
message: "```" + daemonResponse.error + "```",
|
||||||
title: "DAEMON ERROR: resolve"
|
title: "DAEMON ERROR: resolve"
|
||||||
});
|
});
|
||||||
return reject("DAEMON ERROR: resolve");
|
return reject(new Error("DAEMON ERROR: resolve"));
|
||||||
} else
|
} else
|
||||||
return resolve(daemonResponse.result);
|
return resolve(daemonResponse.result);
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
let getTrending = function() {
|
const getTrending = function() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
let options = {
|
const options = {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "https://api.lbry.tv/api/v1/proxy",
|
url: "https://api.lbry.tv/api/v1/proxy",
|
||||||
headers:
|
headers:
|
||||||
|
@ -95,7 +90,7 @@ let getTrending = function() {
|
||||||
message: "```" + error + "```",
|
message: "```" + error + "```",
|
||||||
title: "DAEMON ERROR: trending"
|
title: "DAEMON ERROR: trending"
|
||||||
});
|
});
|
||||||
return reject("DAEMON ERROR: trending");
|
return reject(new Error("DAEMON ERROR: trending"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.prototype.hasOwnProperty.call(daemonResponse, "error")) {
|
if (Object.prototype.hasOwnProperty.call(daemonResponse, "error")) {
|
||||||
|
@ -106,8 +101,6 @@ let getTrending = function() {
|
||||||
return reject(JSON.stringify(daemonResponse));
|
return reject(JSON.stringify(daemonResponse));
|
||||||
} else
|
} else
|
||||||
return resolve(daemonResponse.result.items);
|
return resolve(daemonResponse.result.items);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -123,16 +123,16 @@ function generateContent(exampleNumber, displayTrendingContent) {
|
||||||
const renderedContentCollection = [];
|
const renderedContentCollection = [];
|
||||||
const urlsToResolve = [];
|
const urlsToResolve = [];
|
||||||
|
|
||||||
response.forEach(r =>{
|
response.forEach(r => {
|
||||||
urlsToResolve.push(r.canonical_url);
|
urlsToResolve.push(r.canonical_url);
|
||||||
});
|
});
|
||||||
lbrytvAPI.resolve(urlsToResolve)
|
lbrytvAPI.resolve(urlsToResolve)
|
||||||
.then(resolveResponse => {
|
.then(resolveResponse => {
|
||||||
if (resolveResponse !== null) {
|
if (resolveResponse !== null) {
|
||||||
let responses = Object.values(resolveResponse);
|
const responses = Object.values(resolveResponse);
|
||||||
|
|
||||||
for (let r in responses) {
|
for (const r in responses) {
|
||||||
let part = responses[r];
|
const part = responses[r];
|
||||||
|
|
||||||
if (part.value && part.value.thumbnail.url) {
|
if (part.value && part.value.thumbnail.url) {
|
||||||
renderedContentCollection.push(`
|
renderedContentCollection.push(`
|
||||||
|
@ -188,10 +188,10 @@ function generateContent(exampleNumber, displayTrendingContent) {
|
||||||
lbrytvAPI.resolve(approvedUrls)
|
lbrytvAPI.resolve(approvedUrls)
|
||||||
.then(resolveResponse => {
|
.then(resolveResponse => {
|
||||||
if (resolveResponse !== null) {
|
if (resolveResponse !== null) {
|
||||||
let responses = Object.values(resolveResponse);
|
const responses = Object.values(resolveResponse);
|
||||||
|
|
||||||
for (let r in responses) {
|
for (const r in responses) {
|
||||||
let part = responses[r];
|
const part = responses[r];
|
||||||
|
|
||||||
if (part.value && part.value.thumbnail.url) {
|
if (part.value && part.value.thumbnail.url) {
|
||||||
renderedContentCollection.push(`
|
renderedContentCollection.push(`
|
||||||
|
|
Loading…
Add table
Reference in a new issue