removed unused config still wip on bug

This commit is contained in:
ue 2019-09-10 23:25:52 +03:00
commit 65af4165c4
8 changed files with 59 additions and 60 deletions

View File

@ -78,7 +78,7 @@
"rn-placeholder": "^1.3.2", "rn-placeholder": "^1.3.2",
"speakingurl": "^14.0.1", "speakingurl": "^14.0.1",
"stacktrace-parser": "0.1.4", "stacktrace-parser": "0.1.4",
"steemconnect": "^2.0.1" "steemconnect": "^3.0.4"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.5.5", "@babel/core": "^7.5.5",

View File

@ -17,13 +17,13 @@ import styles from './profileEditFormStyles';
const ProfileEditFormView = ({ const ProfileEditFormView = ({
avatarUrl, avatarUrl,
coverUrl, coverUrl,
isDarkTheme,
formData, formData,
intl,
handleOnItemChange, handleOnItemChange,
showImageUploadActions,
isLoading,
handleOnSubmit, handleOnSubmit,
intl,
isDarkTheme,
isLoading,
showImageUploadActions,
...props ...props
}) => ( }) => (
<View style={styles.container}> <View style={styles.container}>
@ -58,7 +58,7 @@ const ProfileEditFormView = ({
</TouchableOpacity> </TouchableOpacity>
{formData.map(item => ( {formData.map(item => (
<View style={styles.formItem}> <View style={styles.formItem} key={item.valueKey}>
<Text style={styles.label}> <Text style={styles.label}>
{intl.formatMessage({ {intl.formatMessage({
id: `profile.edit.${item.label}`, id: `profile.edit.${item.label}`,
@ -71,7 +71,7 @@ const ProfileEditFormView = ({
onChange={value => handleOnItemChange(value, item.valueKey)} onChange={value => handleOnItemChange(value, item.valueKey)}
placeholder={item.placeholder} placeholder={item.placeholder}
isEditable isEditable
type={item.type} type="none"
value={props[item.valueKey]} value={props[item.valueKey]}
inputStyle={styles.input} inputStyle={styles.input}
/> />

View File

@ -1,6 +1,7 @@
export const steemConnectOptions = { export const steemConnectOptions = {
base_url: 'https://app.steemconnect.com/', base_url: 'https://app.steemconnect.com/',
client_id: 'esteemapp', client_id: 'esteemapp',
redirect_uri: 'http://127.0.0.1:3415/', // http://127.0.0.1:3415 redirect_uri: 'http://127.0.0.1:3415/',
scope: 'vote,comment,delete_comment,comment_options,custom_json,claim_reward_balance,offline', scope:
'vote,comment,delete_comment,comment_options,custom_json,claim_reward_balance,account_update,offline,account_update2',
}; };

View File

@ -1,6 +1,6 @@
/* eslint-disable camelcase */ /* eslint-disable camelcase */
import { Client, PrivateKey } from 'dsteem'; import { Client, PrivateKey } from 'dsteem';
import steemConnect from 'steemconnect'; import steemconnect from 'steemconnect';
import Config from 'react-native-config'; import Config from 'react-native-config';
import get from 'lodash/get'; import get from 'lodash/get';
@ -232,8 +232,8 @@ export const ignoreUser = async (currentAccount, pin, data) => {
const key = getAnyPrivateKey(currentAccount.local, digitPinCode); const key = getAnyPrivateKey(currentAccount.local, digitPinCode);
if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode); const token = decryptKey(currentAccount.local.accessToken, digitPinCode);
const api = steemConnect.Initialize({ const api = new Steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -374,8 +374,8 @@ export const deleteComment = (currentAccount, pin, permlink) => {
const key = getAnyPrivateKey(currentAccount.local, digitPinCode); const key = getAnyPrivateKey(currentAccount.local, digitPinCode);
if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode); const token = decryptKey(currentAccount.local.accessToken, digitPinCode);
const api = steemConnect.Initialize({ const api = new steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -454,8 +454,8 @@ const _vote = async (currentAccount, pin, author, permlink, weight) => {
const key = getAnyPrivateKey(currentAccount.local, digitPinCode); const key = getAnyPrivateKey(currentAccount.local, digitPinCode);
if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode); const token = decryptKey(currentAccount.local.accessToken, digitPinCode);
const api = steemConnect.Initialize({ const api = new steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -755,7 +755,7 @@ export const followUser = async (currentAccount, pin, data) => {
if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode); const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode);
const api = steemConnect.Initialize({ const api = new steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -798,8 +798,8 @@ export const unfollowUser = async (currentAccount, pin, data) => {
const key = getAnyPrivateKey(currentAccount.local, digitPinCode); const key = getAnyPrivateKey(currentAccount.local, digitPinCode);
if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode); const token = decryptKey(currentAccount.local.accessToken, digitPinCode);
const api = steemConnect.Initialize({ const api = new steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -911,7 +911,7 @@ const _postContent = async (
if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) { if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(account.local.accessToken, digitPinCode); const token = decryptKey(account.local.accessToken, digitPinCode);
const api = steemConnect.Initialize({ const api = new steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -1017,7 +1017,7 @@ const _reblog = async (account, pinCode, author, permlink) => {
if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) { if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(account.local.accessToken, pin); const token = decryptKey(account.local.accessToken, pin);
const api = steemConnect.Initialize({ const api = new steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -1056,7 +1056,7 @@ export const claimRewardBalance = (account, pinCode, rewardSteem, rewardSbd, rew
if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) { if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(get(account, 'local.accessToken'), pin); const token = decryptKey(get(account, 'local.accessToken'), pin);
const api = steemConnect.Initialize({ const api = new steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -1170,7 +1170,7 @@ export const profileUpdate = async (params, pin, currentAccount) => {
if (get(currentAccount, 'local.authType') === AUTH_TYPE.STEEM_CONNECT) { if (get(currentAccount, 'local.authType') === AUTH_TYPE.STEEM_CONNECT) {
const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode); const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode);
const api = steemConnect.Initialize({ const api = new steemconnect.Client({
accessToken: token, accessToken: token,
}); });
@ -1182,7 +1182,10 @@ export const profileUpdate = async (params, pin, currentAccount) => {
const opArray = [['account_update', _params]]; const opArray = [['account_update', _params]];
return api.broadcast(opArray).then(resp => resp.result); return api
.broadcast(opArray)
.then(resp => resp.result)
.catch(error => console.log(error));
} }
if (key) { if (key) {

View File

@ -1,6 +1,6 @@
import sc2 from 'steemconnect'; import steemconnect from 'steemconnect';
const api = sc2.Initialize({ const api = new steemconnect.Client({
app: 'esteem-app', app: 'esteem-app',
callbackURL: 'http://127.0.0.1:3415', callbackURL: 'http://127.0.0.1:3415',
}); });

View File

@ -1,6 +0,0 @@
export const steemConnectOptions = {
base_url: 'https://steemconnect.com/oauth2/authorize',
client_id: 'esteem-app',
redirect_uri: 'http://127.0.0.1:3415/', // http://127.0.0.1:3415
scope: 'vote,comment,delete_comment,comment_options,custom_json,claim_reward_balance,offline',
};

View File

@ -5,7 +5,7 @@ import { injectIntl } from 'react-intl';
import { withNavigation } from 'react-navigation'; import { withNavigation } from 'react-navigation';
import { loginWithSC2 } from '../../providers/steem/auth'; import { loginWithSC2 } from '../../providers/steem/auth';
import { steemConnectOptions } from './config'; import { steemConnectOptions } from '../../constants/steemConnectOptions';
// Actions // Actions
import { addOtherAccount, updateCurrentAccount } from '../../redux/actions/accountAction'; import { addOtherAccount, updateCurrentAccount } from '../../redux/actions/accountAction';
@ -79,7 +79,7 @@ class SteemConnect extends PureComponent {
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<WebView <WebView
source={{ source={{
uri: `${steemConnectOptions.base_url}?client_id=${ uri: `${steemConnectOptions.base_url}oauth2/authorize?client_id=${
steemConnectOptions.client_id steemConnectOptions.client_id
}&redirect_uri=${encodeURIComponent( }&redirect_uri=${encodeURIComponent(
steemConnectOptions.redirect_uri, steemConnectOptions.redirect_uri,

View File

@ -2748,13 +2748,13 @@ create-react-context@0.2.2:
fbjs "^0.8.0" fbjs "^0.8.0"
gud "^1.0.0" gud "^1.0.0"
cross-fetch@^2.2.2: cross-fetch@^3.0.1:
version "2.2.3" version "3.0.4"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.4.tgz#7bef7020207e684a7638ef5f2f698e24d9eb283c"
integrity sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw== integrity sha512-MSHgpjQqgbT/94D4CyADeNoYh52zMkCX4pcJvPP5WqPsLFMKjr2TCMg381ox5qI0ii2dPwaLx/00477knXqXVw==
dependencies: dependencies:
node-fetch "2.1.2" node-fetch "2.6.0"
whatwg-fetch "2.0.4" whatwg-fetch "3.0.0"
cross-spawn@^5.0.1, cross-spawn@^5.1.0: cross-spawn@^5.0.1, cross-spawn@^5.1.0:
version "5.1.0" version "5.1.0"
@ -6636,10 +6636,10 @@ nice-try@^1.0.4:
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
node-fetch@2.1.2: node-fetch@2.6.0, node-fetch@^2.1.2, node-fetch@^2.2.0:
version "2.1.2" version "2.6.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
node-fetch@^1.0.1, node-fetch@^1.7.3: node-fetch@^1.0.1, node-fetch@^1.7.3:
version "1.7.3" version "1.7.3"
@ -6649,11 +6649,6 @@ node-fetch@^1.0.1, node-fetch@^1.7.3:
encoding "^0.1.11" encoding "^0.1.11"
is-stream "^1.0.1" is-stream "^1.0.1"
node-fetch@^2.1.2, node-fetch@^2.2.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
node-int64@^0.4.0: node-int64@^0.4.0:
version "0.4.0" version "0.4.0"
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
@ -8990,13 +8985,19 @@ stealthy-require@^1.1.1:
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=
steemconnect@^2.0.1: steem-uri@^0.1.1:
version "2.0.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/steemconnect/-/steemconnect-2.0.1.tgz#bdcec947c18bbc2cb66c8de0bae5bf6582adcec9" resolved "https://registry.yarnpkg.com/steem-uri/-/steem-uri-0.1.1.tgz#20da6f713809398b5f77d251def0eeed92cf966b"
integrity sha512-ympGGVICdTKCWzfUV8/2WTNao/zfsM1J131sbsgSJFr4fu1Ombo5gdNaF6PxOKlcFe3A+ZkkqUJjiBXTqlFuig== integrity sha512-pHe33AlDLlf2jC8hfrEthVj8Zq/DcFg490ID16KK0o7tr02mToeXTpEFGV5dnM2ASeAr3MAOxCJvEFDrCFuZbQ==
steemconnect@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/steemconnect/-/steemconnect-3.0.4.tgz#a5c33060cb10a1e525e47714158ad85d73d3dea9"
integrity sha512-m1aCOF80jc4mr0rn3PI+yVRdsdtHxksPbLznSAl0Cnp9hsjzICexeO5T4E6hBU91egG03JRQn3xnQj+c5qQGUA==
dependencies: dependencies:
babel-runtime "^6.26.0" babel-runtime "^6.26.0"
cross-fetch "^2.2.2" cross-fetch "^3.0.1"
steem-uri "^0.1.1"
stream-buffers@~2.2.0: stream-buffers@~2.2.0:
version "2.2.0" version "2.2.0"
@ -9677,16 +9678,16 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
dependencies: dependencies:
iconv-lite "0.4.24" iconv-lite "0.4.24"
whatwg-fetch@2.0.4, whatwg-fetch@^2.0.3: whatwg-fetch@3.0.0, whatwg-fetch@>=0.10.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"
integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==
whatwg-fetch@>=0.10.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
whatwg-fetch@^2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"
integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==
whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0:
version "2.3.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"