diff --git a/ui/constants/channels.js b/ui/constants/channels.js index 9693add03..94f4e5bae 100644 --- a/ui/constants/channels.js +++ b/ui/constants/channels.js @@ -21,3 +21,11 @@ export const COMMUNITY_CHANNELS = Object.freeze({ es: ES_CHANNELS, de: DE_CHANNELS, }); + +// **************************************************************************** +// **************************************************************************** + +export const ODYSEE_CHANNEL = Object.freeze({ + ID: '80d2590ad04e36fb1d077a9b9e3a8bba76defdf8', + NAME: '@odysee', +}); diff --git a/ui/page/odyseeMembership/view.jsx b/ui/page/odyseeMembership/view.jsx index 2e77b41e3..35cf97e14 100644 --- a/ui/page/odyseeMembership/view.jsx +++ b/ui/page/odyseeMembership/view.jsx @@ -6,6 +6,7 @@ import Page from 'component/page'; import Spinner from 'component/spinner'; import { Lbryio } from 'lbryinc'; import { getStripeEnvironment } from 'util/stripe'; +import { ODYSEE_CHANNEL } from 'constants/channels'; import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import * as MODALS from 'constants/modal_types'; @@ -21,10 +22,6 @@ import usePersistedState from 'effects/use-persisted-state'; const stripeEnvironment = getStripeEnvironment(); const isDev = process.env.NODE_ENV !== 'production'; -// odysee channel information since the memberships are only for Odysee -const odyseeChannelId = '80d2590ad04e36fb1d077a9b9e3a8bba76defdf8'; -const odyseeChannelName = '@odysee'; - function log(...args) { // @if process.env.LOG_MEMBERSHIP='true' console.log(args); @@ -180,8 +177,9 @@ const OdyseeMembershipPage = (props: Props) => { 'list', { environment: stripeEnvironment, - channel_id: odyseeChannelId, - channel_name: odyseeChannelName, + // Using @odysee's channel info as memberships are only for @odysee. + channel_id: ODYSEE_CHANNEL.ID, + channel_name: ODYSEE_CHANNEL.NAME, }, 'post' ); diff --git a/ui/redux/actions/user.js b/ui/redux/actions/user.js index 54b61514c..ca53fb218 100644 --- a/ui/redux/actions/user.js +++ b/ui/redux/actions/user.js @@ -4,7 +4,7 @@ import { doFetchChannelListMine } from 'redux/actions/claims'; import { isURIValid, normalizeURI } from 'util/lbryURI'; import { batchActions } from 'util/batch-actions'; import { getStripeEnvironment } from 'util/stripe'; - +import { ODYSEE_CHANNEL } from 'constants/channels'; import * as ACTIONS from 'constants/action_types'; import { doFetchGeoBlockedList } from 'redux/actions/blocked'; import { doClaimRewardType, doRewardList } from 'redux/actions/rewards'; @@ -15,14 +15,13 @@ import rewards from 'rewards'; import { Lbryio } from 'lbryinc'; import { DOMAIN, LOCALE_API } from 'config'; import { getDefaultLanguage } from 'util/default-languages'; + const AUTH_IN_PROGRESS = 'authInProgress'; export let sessionStorageAvailable = false; const CHECK_INTERVAL = 200; const AUTH_WAIT_TIMEOUT = 10000; const stripeEnvironment = getStripeEnvironment(); -const ODYSEE_CHANNEL_ID = '80d2590ad04e36fb1d077a9b9e3a8bba76defdf8'; - export function doFetchInviteStatus(shouldCallRewardList = true) { return (dispatch) => { dispatch({ @@ -912,7 +911,7 @@ export function doFetchUserMemberships(claimIdCsv) { // check if users have odysee memberships (premium/premium+) const response = await Lbryio.call('membership', 'check', { - channel_id: ODYSEE_CHANNEL_ID, + channel_id: ODYSEE_CHANNEL.ID, claim_ids: claimIdCsv, environment: stripeEnvironment, });