From 226632d8b66e51c03edf22221a077c500d6a7ef0 Mon Sep 17 00:00:00 2001 From: Young Leo Date: Thu, 22 Nov 2018 19:02:37 +0800 Subject: [PATCH 1/3] trace import && add ui --- .env.development | 2 +- shared/sagas/eosAccount.ts | 7 +++---- shared/sagas/trace.ts | 11 +++++++++++ shared/screens/Assets/MenuPopUp/index.jsx | 15 ++++++++------- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.env.development b/.env.development index b8332d61a..17529ae80 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ ENV=development BITPORTAL_API_REST_URL=https://staging-api.bitportal.io BITPORTAL_API_MARKET_URL=https://market.bitportal.io/api/v2 -BITPROTAL_API_TRACE_URL=http://a276fba2.ngrok.io +BITPROTAL_API_TRACE_URL=http://35.187.150.99 BITPORTAL_API_WEBSOCKET_URL=ws://staging-api.bitportal.io BITPORTAL_API_CMS_URL=https://cms.bitportal.io BITPORTAL_API_EOS_URL=https://api-kylin.eosasia.one diff --git a/shared/sagas/eosAccount.ts b/shared/sagas/eosAccount.ts index 9c0f2b87a..03046c3dd 100644 --- a/shared/sagas/eosAccount.ts +++ b/shared/sagas/eosAccount.ts @@ -208,9 +208,9 @@ function* importEOSAccountRequested(action: Action) { walletId: eosAccountName, chainType: 'eos', ownerKey: publicKey, - activeKey: publicKey, - note: '' + activeKey: publicKey } + // console.log('###--', params) yield put(traceImport(params)) } catch (e) { yield put(actions.importEOSAccountFailed(getErrorMessage(e))) @@ -256,7 +256,7 @@ function* getEOSKeyAccountsRequested(action: Action) { function* getEOSAccountRequested(action: Action) { if (!action.payload) return - + try { const eosAccountName = action.payload.eosAccountName const eosAccountCreationInfo = yield select((state: RootState) => state.eosAccount.get('eosAccountCreationInfo')) @@ -278,7 +278,6 @@ function* getEOSAccountRequested(action: Action) { const code = 'eosio.token' const data = yield call(eos.getCurrencyBalance, { code, account: eosAccountName }) const symbol = (data && data[0]) ? data[0].split(' ')[1] : 'eos' - const params = { language, deviceId, diff --git a/shared/sagas/trace.ts b/shared/sagas/trace.ts index e504725d6..46ceb3159 100644 --- a/shared/sagas/trace.ts +++ b/shared/sagas/trace.ts @@ -33,8 +33,19 @@ function* traceVotes(action: Action) { } } +function* traceImport(action: Action) { + if (!action.payload) return + + try { + yield call(api.traceImport, action.payload) + } catch (e) { + console.log('###', e) + } +} + export default function* tokenSaga() { yield takeEvery(String(actions.traceTransaction), traceTransaction) yield takeEvery(String(actions.traceStake), traceStake) yield takeEvery(String(actions.traceVotes), traceVotes) + yield takeEvery(String(actions.traceImport), traceImport) } diff --git a/shared/screens/Assets/MenuPopUp/index.jsx b/shared/screens/Assets/MenuPopUp/index.jsx index f2358831f..0b61316c6 100644 --- a/shared/screens/Assets/MenuPopUp/index.jsx +++ b/shared/screens/Assets/MenuPopUp/index.jsx @@ -21,12 +21,6 @@ const styles = StyleSheet.create({ borderBottomWidth: StyleSheet.hairlineWidth, backgroundColor: Colors.bgColor_30_31_37 }, - bgContainer: { - marginTop: -SCREEN_HEIGHT, - paddingHorizontal: 15, - justifyContent: 'flex-end', - flexDirection: 'row', - }, center: { alignItems: 'center', justifyContent: 'center' @@ -36,12 +30,19 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', flexDirection: 'row' }, + bgContainer: { + marginTop: -SCREEN_HEIGHT+NAV_BAR_HEIGHT, + width: 170, + minHeight: 100, + marginLeft: SCREEN_WIDTH-180, + justifyContent: 'flex-end', + flexDirection: 'row', + }, contentContainer: { borderRadius: 5, minWidth: 100, minHeight: 100, padding: 15, - marginTop: NAV_BAR_HEIGHT, backgroundColor: Colors.minorThemeColor }, btnContainer: { From bd07460cf082d67ed019c6514ddf3325981841c9 Mon Sep 17 00:00:00 2001 From: Young Leo Date: Thu, 22 Nov 2018 21:35:47 +0800 Subject: [PATCH 2/3] camera access stirngID --- ios/bitportal/en.lproj/InfoPlist.strings | 2 +- ios/bitportal/zh-Hans.lproj/InfoPlist.strings | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/bitportal/en.lproj/InfoPlist.strings b/ios/bitportal/en.lproj/InfoPlist.strings index f4a9379f6..00b895e84 100644 --- a/ios/bitportal/en.lproj/InfoPlist.strings +++ b/ios/bitportal/en.lproj/InfoPlist.strings @@ -7,7 +7,7 @@ */ "NSPhotoLibraryUsageDescription" = "Enable album access"; "NSBluetoothPeripheralUsageDescription" = "Enable bluetooth access"; -"NSCameraUsageDescription" = "Enable camera access"; +"NSCameraUsageDescription" = "\"BitPortal\" request to enable camera access to scan the QR code"; "NSAppleMusicUsageDescription" = "Enable media access"; "NSMotionUsageDescription" = "Enable fitness access"; "NSSpeechRecognitionUsageDescription" = "Enable microphone access"; diff --git a/ios/bitportal/zh-Hans.lproj/InfoPlist.strings b/ios/bitportal/zh-Hans.lproj/InfoPlist.strings index 0f8a0973a..c73f8e04b 100644 --- a/ios/bitportal/zh-Hans.lproj/InfoPlist.strings +++ b/ios/bitportal/zh-Hans.lproj/InfoPlist.strings @@ -7,7 +7,7 @@ */ "NSPhotoLibraryUsageDescription" = "开启相册权限"; "NSBluetoothPeripheralUsageDescription" = "开启蓝牙权限"; -"NSCameraUsageDescription" = "开启摄像权限"; +"NSCameraUsageDescription" = "\"BitPortal\"请求开启摄像头权限以扫描二维码"; "NSAppleMusicUsageDescription" = "访问媒体资料库"; "NSMotionUsageDescription" = "开启运动健身权限"; "NSSpeechRecognitionUsageDescription" = "开启语音识别权限"; From e057b31e02204e3f2d3410ef9d83ea0c5950fa79 Mon Sep 17 00:00:00 2001 From: Young Leo Date: Thu, 22 Nov 2018 21:37:37 +0800 Subject: [PATCH 3/3] lint --- shared/sagas/eosAccount.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/sagas/eosAccount.ts b/shared/sagas/eosAccount.ts index 03046c3dd..0cdcd54ca 100644 --- a/shared/sagas/eosAccount.ts +++ b/shared/sagas/eosAccount.ts @@ -241,7 +241,7 @@ function* getEOSKeyAccountsRequested(action: Action) { } yield put(actions.getEOSKeyAccountsSucceeded(result)) - if (action.payload.componentId) + if (action.payload.componentId) { push('BitPortal.AccountSelection', action.payload.componentId, { keyPermissions, publicKey, @@ -249,6 +249,7 @@ function* getEOSKeyAccountsRequested(action: Action) { password, hint }) + } } catch (e) { yield put(actions.getEOSKeyAccountsFailed(getEOSErrorMessage(e))) }