specify first run follow in config

This commit is contained in:
jessop 2020-07-14 18:49:10 -04:00 committed by Sean Yesmunt
parent b8e1990439
commit 81ffd7ae79
4 changed files with 14 additions and 11 deletions

View file

@ -30,6 +30,8 @@ DEFAULT_LANGUAGE=en
# Custom Content
# If the following is true, copy custom/homepage.example.js to custom/homepage.js and modify
CUSTOM_HOMEPAGE=false
# Add channels to auto-follow on first run
AUTO_FOLLOW_CHANNELS=lbry://@lbrycast#4c29f8b013adea4d5cca1861fb2161d5089613ea lbry://@lbry#3fda836a92faaceedfe398225fb9b2ee2ed1f01a
# Add up to 2 sidebar links:
# PINNED_URI_1=@Lbrylatam#2/Integracionesporseguridad#4
# PINNED_LABEL_1=LBRY LATAM

View file

@ -113,6 +113,9 @@ nano .env
- To specify your own OG-IMAGE
You can either place a png named v2-og.png in the /custom folder or specify the OG_IMAGE_URL in .env
- To specify your own channels to be followed on first run
`AUTO_FOLLOW_URLS=lbry://@chan#123...a lbry://@chan2#456...a`
- If you want to customize the homepage content
1. add `CUSTOM_HOMEPAGE=true` to the '.env' file

View file

@ -21,6 +21,7 @@ const config = {
OG_IMAGE_URL: process.env.OG_IMAGE_URL,
SITE_CANONICAL_URL: process.env.SITE_CANONICAL_URL,
DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE,
AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS,
PINNED_URI_1: process.env.PINNED_URI_1,
PINNED_LABEL_1: process.env.PINNED_LABEL_1,

View file

@ -6,6 +6,7 @@ import Nag from 'component/common/nag';
import { parseURI } from 'lbry-redux';
import Button from 'component/button';
import Card from 'component/common/card';
import { AUTO_FOLLOW_CHANNELS } from 'config';
type Props = {
subscribedChannels: Array<Subscription>,
@ -14,8 +15,7 @@ type Props = {
channelSubscribe: (sub: Subscription) => void,
};
const LBRY_URI = 'lbry://@lbry#3fda836a92faaceedfe398225fb9b2ee2ed1f01a';
const LBRYCAST_URI = 'lbry://@lbrycast#4c29f8b013adea4d5cca1861fb2161d5089613ea';
const channelsToSubscribe = AUTO_FOLLOW_CHANNELS.trim().split(' ');
function UserChannelFollowIntro(props: Props) {
const { subscribedChannels, channelSubscribe, onContinue, onBack } = props;
@ -23,15 +23,12 @@ function UserChannelFollowIntro(props: Props) {
// subscribe to lbry
useEffect(() => {
channelSubscribe({
channelName: parseURI(LBRY_URI).claimName,
uri: LBRY_URI,
});
channelSubscribe({
channelName: parseURI(LBRYCAST_URI).claimName,
uri: LBRYCAST_URI,
});
channelsToSubscribe.forEach(c =>
channelSubscribe({
channelName: parseURI(c).claimName,
uri: c,
})
);
}, []);
return (