From 99b446a8fe1826d75b0b551cb5576ec141aa690d Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Wed, 13 Apr 2022 22:53:58 +0800 Subject: [PATCH] Use baked-in homepages until service is moved elsewhere The code currently supports both the baked-in homepages, as well as fetching from `/$/api/content/v1/get`. As the latter is currently a circular round-trip, just use the baked-in version until the service is moved elsewhere. Loading performance will be better. --- .env.defaults | 2 +- ui/redux/actions/settings.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.env.defaults b/.env.defaults index f0435a696..34055c0af 100644 --- a/.env.defaults +++ b/.env.defaults @@ -58,6 +58,7 @@ SHOW_ADS=true ENABLE_MATURE=false ENABLE_UI_NOTIFICATIONS=true #SHOW_TAGS_INTRO=false +USE_LOCAL_HOMEPAGE_DATA=true AUTO_FOLLOW_CHANNELS=lbry://@lbry#3fda836a92faaceedfe398225fb9b2ee2ed1f01a @@ -108,4 +109,3 @@ FIREBASE_VAPID_KEY=BFayEBpwMTU9GQQpXgitIJkfx-SD8-ltrFb3wLTZWgA27MfBhG4948pe0eERl # --- Development --- REPORT_NEW_STRINGS=false -USE_LOCAL_HOMEPAGE_DATA=false diff --git a/ui/redux/actions/settings.js b/ui/redux/actions/settings.js index 9c62d833d..235b822ad 100644 --- a/ui/redux/actions/settings.js +++ b/ui/redux/actions/settings.js @@ -310,11 +310,12 @@ export function doFetchLanguage(language) { export function doFetchHomepages() { return (dispatch) => { - // -- Use this env flag to use local homepage data. Otherwise, it will grab from odysee.com. + // -- Use this env flag to use local homepage data. Otherwise, it will grab from `/$/api/content/v1/get`. // @if USE_LOCAL_HOMEPAGE_DATA='true' const homepages = require('homepages'); if (homepages) { window.homepages = homepages; + dispatch({ type: ACTIONS.FETCH_HOMEPAGES_DONE }); return; } // @endif