used postUrlParser instead of deepLinkParser

This commit is contained in:
Sadaqat Ali 2022-05-30 22:09:10 +05:00
parent 68279ba5d2
commit 09bd4b90c7
2 changed files with 8 additions and 9 deletions

View File

@ -22,6 +22,7 @@ import { Modal } from '../modal';
import styles from './postBoostStyles';
import { OptionsModal } from '../atoms';
import { deepLinkParser } from '../../utils/deepLinkParser';
import postUrlParser from '../../utils/postUrlParser';
class BoostPostScreen extends PureComponent {
/* Props
@ -113,14 +114,12 @@ class BoostPostScreen extends PureComponent {
handleOnSubmit(redeemType, amount, fullPermlink, selectedUser);
};
_validateUrl = async () => {
_validateUrl = () => {
const { permlink } = this.state;
const { user } = this.props;
const deepLinkData = await deepLinkParser(permlink, user);
console.log('deepLinkData : ', deepLinkData);
const { routeName, params, key } = deepLinkData || {};
if (routeName && key && params && params.content) {
let postPermlink = `${params.content.author}/${params.content.permlink}`;
const postUrl = postUrlParser(permlink);
console.log('postUrl : ', postUrl);
if (postUrl && postUrl.author && postUrl.permlink) {
let postPermlink = `${postUrl.author}/${postUrl.permlink}`;
this.setState({
permlink: postPermlink,
isValid: true,

View File

@ -56,7 +56,7 @@ export const deepLinkParser = async (url, currentAccount) => {
}
}
if (feedType && ( feedType === 'hot' || feedType === 'trending' || feedType === 'created' )) {
if (feedType === 'hot' || feedType === 'trending' || feedType === 'created') {
if (!tag) {
routeName = ROUTES.SCREENS.TAG_RESULT;
} else if (/hive-[1-3]\d{4,6}$/.test(tag)) {
@ -73,7 +73,7 @@ export const deepLinkParser = async (url, currentAccount) => {
if (!routeName) {
const { mode, referredUser } = parseAuthUrl(url) || {};
if (mode && referredUser && mode === 'SIGNUP') {
if (mode === 'SIGNUP') {
routeName = ROUTES.SCREENS.REGISTER;
params = {
referredUser,