mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 03:11:38 +03:00
used postUrlParser instead of deepLinkParser
This commit is contained in:
parent
68279ba5d2
commit
09bd4b90c7
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user