• R/O
  • HTTP
  • SSH
  • HTTPS

bytom-dashboard: コミット

dashboard of Bytom


コミットメタ情報

リビジョンf69b56ff0124035e6a03ab5460c4673f6b4991f2 (tree)
日時2021-06-11 17:07:47
作者j <coffce404@gmai...>
コミッターj

ログメッセージ

fix: ignore backup api error

変更サマリ

差分

--- a/src/features/accounts/actions.js
+++ b/src/features/accounts/actions.js
@@ -72,10 +72,11 @@ const createAccount = (data) => {
7272 .then((backupRes) => {
7373 if (backupRes.status === 'fail') throw backupRes
7474 const keystore = backupRes.data.key_images.xkeys.find((item) => item.xpub === keyRes.data.xpub)
75- const cryptoMnemonic = bytom.encryptMnemonic(keyRes.data.mnemonic, keyData.password, keystore)
76- localStorage.setItem(`mnemonic:${keyRes.data.xpub}`, cryptoMnemonic)
75+ if (keystore) {
76+ bytom.saveMnemonic(keyRes.data.mnemonic, keyRes.data.xpub, keyData.password, keystore)
77+ }
7778 })
78- .then(() => {
79+ .finally(() => {
7980 return chainClient()
8081 .accounts.create(accountData)
8182 .then((resp) => {
--- a/src/features/initialization/actions.js
+++ b/src/features/initialization/actions.js
@@ -109,9 +109,11 @@ const restoreMnemonic = (data, success) => {
109109 .then((res) => {
110110 if (res.status === 'fail') throw res
111111 const keystore = res.data.key_images.xkeys.find((item) => item.xpub === xpub)
112- if (!keystore) throw { _error: 'Unknown error' }
113- bytom.saveMnemonic(data.mnemonic, xpub, data.password, keystore)
114-
112+ if (keystore) {
113+ bytom.saveMnemonic(data.mnemonic, xpub, data.password, keystore)
114+ }
115+ })
116+ .finally(() => {
115117 dispatch(success)
116118 })
117119 })
旧リポジトリブラウザで表示