mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fixing error handling for publish()
(MobileSync) (#11909)
This commit is contained in:
parent
dc3e74a66a
commit
b021c35f7b
@ -2418,6 +2418,9 @@
|
||||
"symbolBetweenZeroTwelve": {
|
||||
"message": "Symbol must be 11 characters or fewer."
|
||||
},
|
||||
"syncFailed": {
|
||||
"message": "Sync failed"
|
||||
},
|
||||
"syncInProgress": {
|
||||
"message": "Sync in progress"
|
||||
},
|
||||
|
@ -201,9 +201,9 @@ export default class MobileSyncPage extends Component {
|
||||
sendByPost: false, // true to send via post
|
||||
storeInHistory: false,
|
||||
},
|
||||
(status, response) => {
|
||||
(status, _response) => {
|
||||
if (status.error) {
|
||||
reject(response);
|
||||
reject(status.errorData);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
@ -225,6 +225,7 @@ export default class MobileSyncPage extends Component {
|
||||
preferences,
|
||||
transactions,
|
||||
} = await this.props.fetchInfoToSync();
|
||||
const { t } = this.context;
|
||||
|
||||
const allDataStr = JSON.stringify({
|
||||
accounts,
|
||||
@ -245,7 +246,7 @@ export default class MobileSyncPage extends Component {
|
||||
await this.sendMessage(chunks[i], i + 1, totalChunks);
|
||||
}
|
||||
} catch (e) {
|
||||
this.props.displayWarning('Sync failed :(');
|
||||
this.props.displayWarning(`${t('syncFailed')} :(`);
|
||||
this.setState({ syncing: false });
|
||||
this.syncing = false;
|
||||
this.notifyError(e.toString());
|
||||
@ -266,9 +267,9 @@ export default class MobileSyncPage extends Component {
|
||||
sendByPost: false, // true to send via post
|
||||
storeInHistory: false,
|
||||
},
|
||||
(status, response) => {
|
||||
(status, _response) => {
|
||||
if (status.error) {
|
||||
reject(response);
|
||||
reject(status.errorData);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user