diff --git a/src/components/ChannelDetails.jsx b/src/components/ChannelDetails.jsx index 9d02827533..0ed3d08907 100644 --- a/src/components/ChannelDetails.jsx +++ b/src/components/ChannelDetails.jsx @@ -17,7 +17,7 @@ import useModalBlur, { MODAL_POSITION } from 'hooks/useModalBlur'; import useToast from 'hooks/useToast'; import { Section } from 'primaries/SharedStyling'; import { MdCheckCircle, MdError } from 'react-icons/md'; -import ChannelsDataStore from 'singletons/ChannelsDataStore'; +// import ChannelsDataStore from 'singletons/ChannelsDataStore'; import RedCircleSvg from '../assets/RedCircle.svg?react'; import AddDelegateModalContent from './AddDelegateModalContent'; import ChannelSettings from './ChannelSettings'; @@ -109,8 +109,8 @@ export default function ChannelDetails({ isChannelExpired, setIsChannelExpired, useEffect(() => { if (!channelDetails || !canVerify) return; (async function () { - let channelJson = await ChannelsDataStore.getInstance().getChannelJsonAsync(channelDetails.verifiedBy); - setVerifyingChannel(channelJson); + // let channelJson = await ChannelsDataStore.getInstance().getChannelJsonAsync(channelDetails.verifiedBy); + // setVerifyingChannel(channelJson); })(); }, [channelDetails, canVerify]); diff --git a/src/components/InitState.tsx b/src/components/InitState.tsx index e7278b88d7..2911d57a07 100644 --- a/src/components/InitState.tsx +++ b/src/components/InitState.tsx @@ -27,12 +27,13 @@ import { setPushAdmin, } from 'redux/slices/contractSlice'; import { getAliasDetails, getUserDelegations } from 'services'; -import ChannelsDataStore from 'singletons/ChannelsDataStore'; +// import ChannelsDataStore from 'singletons/ChannelsDataStore'; import UsersDataStore from 'singletons/UsersDataStore'; // Internals Configs import { abis, addresses, appConfig, CHAIN_DETAILS } from 'config/index.js'; import useSDKStream from 'hooks/useStream'; +import { getChannelDetails } from 'queries'; // Constants const CORE_CHAIN_ID = appConfig.coreContractChain; @@ -100,8 +101,8 @@ const InitState = () => { // Push (EPNS) Read Provider Set if (epnsReadProvider != null && epnsCommReadProvider != null) { // Instantiate Data Stores - UsersDataStore.getInstance().init(account, epnsReadProvider, epnsCommReadProvider); - ChannelsDataStore.getInstance().init(account, epnsReadProvider, epnsCommReadProvider, chainId); + // UsersDataStore.getInstance().init(account, epnsReadProvider, epnsCommReadProvider); + // ChannelsDataStore.getInstance().init(account, epnsReadProvider, epnsCommReadProvider, chainId); } }, [epnsReadProvider, epnsCommReadProvider, epnsWriteProvider]); @@ -209,14 +210,16 @@ const InitState = () => { }; const checkUserForAlias = async (account, userPushSDKInstance) => { - let { aliasAddress = null, isAliasVerified = null } = - await ChannelsDataStore.getInstance().getChannelDetailsFromAddress(account, userPushSDKInstance); - if (aliasAddress == 'NULL') aliasAddress = null; + let { alias_address = null, is_alias_verified = null } = await getChannelDetails({ + userPushSDKInstance, + address: account, + }).then((response) => response); + if (alias_address == 'NULL') alias_address = null; - if (aliasAddress) { - dispatch(setAliasAddress(aliasAddress)); - dispatch(setAliasVerified(isAliasVerified)); - if (isAliasVerified) { + if (alias_address) { + dispatch(setAliasAddress(alias_address)); + dispatch(setAliasVerified(is_alias_verified)); + if (is_alias_verified) { dispatch(setAliasVerified(true)); dispatch(setProcessingState(0)); } else { diff --git a/src/components/ViewChannelItem.jsx b/src/components/ViewChannelItem.jsx index de34c83a4c..22f80ef6bc 100644 --- a/src/components/ViewChannelItem.jsx +++ b/src/components/ViewChannelItem.jsx @@ -26,7 +26,7 @@ import useToast from 'hooks/useToast'; import { cacheChannelInfo } from 'redux/slices/channelSlice'; import { addNewWelcomeNotif, incrementStepIndex } from 'redux/slices/userJourneySlice'; import ChannelTutorial, { isChannelTutorialized } from 'segments/ChannelTutorial'; -import ChannelsDataStore from 'singletons/ChannelsDataStore'; +// import ChannelsDataStore from 'singletons/ChannelsDataStore'; import InfoImage from '../assets/info.svg'; import RedCircleSvg from '../assets/RedCircle.svg?react'; import NotificationToast from '../primaries/NotificationToast'; @@ -111,7 +111,9 @@ function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, p const fetchChannelJsonWithBlock = async () => { try { //TODO:here is the data store - const channelJson = await ChannelsDataStore.getInstance().getChannelJsonStartBlockAsync(channelObject.channel); + const channelJson = {}; + + // await ChannelsDataStore.getInstance().getChannelJsonStartBlockAsync(channelObject.channel); console.log('Channel JSON !!!!!', channelJson, channelObject.channel); return channelJson; } catch (err) { @@ -450,19 +452,19 @@ function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, p placementProps={ tooltTipHeight < 250 ? { - background: 'none', - // bottom: "25px", - top: '20px', - // right: "-175px", - left: mobileToolTip ? '-100px' : '5px', - } + background: 'none', + // bottom: "25px", + top: '20px', + // right: "-175px", + left: mobileToolTip ? '-100px' : '5px', + } : { - background: 'none', - bottom: '25px', - // top: "20px", - // right: "-175px", - left: mobileToolTip ? '-100px' : '5px', - } + background: 'none', + bottom: '25px', + // top: "20px", + // right: "-175px", + left: mobileToolTip ? '-100px' : '5px', + } } tooltipContent={