NSFW content is not shown on Tour

This commit is contained in:
ポール ウェッブ 2018-08-09 09:38:42 -05:00
parent fadbe03e83
commit 70e292f39a
4 changed files with 12 additions and 24 deletions

View file

@ -29,40 +29,23 @@ module.exports = exports = (data, socket) => {
if (data.step === 2 && !data.data) return; if (data.step === 2 && !data.data) return;
if (data.step === 2) dataDetails = data.data; // file upload if (data.step === 2) dataDetails = data.data; // file upload
const claimAddress = data.claim;
const resolveMethod = data.method;
/*
const allowedClaims = [
"fortnite-top-stream-moments-nickatnyte",
"hellolbry",
"itsadisaster",
"six",
"unbubbled1-1"
];
*/
const allowedMethods = [ const allowedMethods = [
"publish", "publish",
"resolve", "resolve",
"wallet_send" "wallet_send"
]; ];
const body = {};
const claimAddress = data.claim;
const resolveMethod = data.method;
if (allowedMethods.indexOf(resolveMethod) < 0) return socket.send(JSON.stringify({ if (allowedMethods.indexOf(resolveMethod) < 0) return socket.send(JSON.stringify({
"details": "Unallowed resolve method for tutorial", "details": "Unallowed resolve method for tutorial",
"message": "notification", "message": "notification",
"type": "error" "type": "error"
})); }));
/*
if (data.step === 1 && allowedClaims.indexOf(claimAddress) < 0) return socket.send(JSON.stringify({
"details": "Invalid claim ID for tutorial",
"message": "notification",
"type": "error"
}));
*/
const body = {};
body.access_token = process.env.LBRY_DAEMON_ACCESS_TOKEN; body.access_token = process.env.LBRY_DAEMON_ACCESS_TOKEN;
body.method = resolveMethod; body.method = resolveMethod;

View file

@ -295,7 +295,7 @@ function generateStep1OfTour(displayTrendingContent) {
Promise.all(rawContentCollection).then(collection => { Promise.all(rawContentCollection).then(collection => {
for (const part of collection) { for (const part of collection) {
if (part.value.stream.metadata.thumbnail) { if (!part.value.stream.metadata.nsfw && part.value.stream.metadata.thumbnail) {
renderedContentCollection.push(` renderedContentCollection.push(`
<figure class="tour__content__trend"> <figure class="tour__content__trend">
<img alt="${part.name}" data-action="choose claim" data-claim-id="${part.name}" src="${part.value.stream.metadata.thumbnail}"/> <img alt="${part.name}" data-action="choose claim" data-claim-id="${part.name}" src="${part.value.stream.metadata.thumbnail}"/>

View file

@ -25,7 +25,7 @@ module.exports = exports = () => async () => html`
<ul class="home__features"> <ul class="home__features">
<li class="home__feature"> <li class="home__feature">
<p class="home__feature__title"><strong>New to LBRY?</strong></p> <p class="home__feature__title"><strong>New to LBRY?</strong></p>
<p class="home__feature__description">Learn how LBRY works in 3 easy steps</p> <p class="home__feature__description">Learn how LBRY works with 3 easy examples</p>
<a class="home__feature__cta" href="/tour">Take the Tour</a> <a class="home__feature__cta" href="/tour">Take the Tour</a>
</li> </li>

View file

@ -80,6 +80,11 @@ $("body").on("click", ".hook__page__content__meme__thumbnail", event => {
updateCanvas(event.currentTarget); updateCanvas(event.currentTarget);
}); });
$("#fetch-claim-uri").on("keyup", function (e) {
const key = e.keyCode ? e.keyCode : e.which;
if (key === 13 && $("#fetch-claim-uri").val()) fetchMetadata(1, $("#fetch-claim-uri").val());
});
$("#meme-top-line, #meme-bottom-line").on("keyup", () => updateCanvas()); $("#meme-top-line, #meme-bottom-line").on("keyup", () => updateCanvas());
@ -106,7 +111,7 @@ function detectLanguageAndUpdate() {
} }
function initializeTour() { function initializeTour() {
$("#fetch-claim-uri").val(""); // reset $("#fetch-claim-uri").val("").focus(); // reset
$(".tour__sidebar__step:nth-child(1)").addClass("active"); $(".tour__sidebar__step:nth-child(1)").addClass("active");
send(JSON.stringify({ send(JSON.stringify({