Cleaned up script intiailization data

refs https://github.com/TryGhost/members.js/issues/6

Removes all data initialization setup except `adminUrl` as we now fetch everything directly from API
This commit is contained in:
Rish 2020-04-20 22:12:08 +05:30
parent 028139a0e1
commit e59e8186bd
2 changed files with 3 additions and 13 deletions

View File

@ -1,2 +1 @@
REACT_APP_ADMIN_URL=http://localhost:2368/ghost
REACT_APP_SITE_URL=http://localhost:2368

View File

@ -16,17 +16,8 @@ window.GhostMembers = {
initMembersJS: initMembersJS
};
// This will automatically load for local if an .env.local file is present
// This will automatically load for local if an .env.development.local file is present
if (process.env.REACT_APP_ADMIN_URL) {
let site = {
adminUrl: process.env.REACT_APP_ADMIN_URL,
siteUrl: process.env.REACT_APP_SITE_URL || process.env.REACT_APP_ADMIN_URL,
plans: {
monthly: process.env.REACT_APP_SITE_MONTHLY_PLAN || '10',
yearly: process.env.REACT_APP_SITE_YEARLY_PLAN || '99',
currency: process.env.REACT_APP_SITE_PLAN_CURRENCY || 'USD',
currencySymbol: process.env.REACT_APP_SITE_PLAN_CURRENCY_SYMBOL || '$'
}
};
initMembersJS({site});
const adminUrl = process.env.REACT_APP_ADMIN_URL;
initMembersJS({adminUrl});
}