diff --git a/src/components/postBoost/postBoostView.js b/src/components/postBoost/postBoostView.js index dd88df7d4..322e096ce 100644 --- a/src/components/postBoost/postBoostView.js +++ b/src/components/postBoost/postBoostView.js @@ -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, diff --git a/src/utils/deepLinkParser.ts b/src/utils/deepLinkParser.ts index c8051432b..7eda69d98 100644 --- a/src/utils/deepLinkParser.ts +++ b/src/utils/deepLinkParser.ts @@ -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,