Skip to content

Commit

Permalink
Fix sync crash (#549)
Browse files Browse the repository at this point in the history
* version bump

* fix sync crash
  • Loading branch information
Bruno Barbieri authored Mar 21, 2019
1 parent c2f5d54 commit 8d3abe4
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 14 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 6
versionName "0.1.5"
versionCode 7
versionName "0.1.6"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
Expand Down
15 changes: 11 additions & 4 deletions app/components/Views/ImportWallet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,17 @@ class ImportWallet extends Component {
showQrCode = () => {
this.props.navigation.push('QRScanner', {
onScanSuccess: data => {
const result = data.content.replace('metamask-sync:', '').split('|@|');
this.channelName = result[0];
this.cipherKey = result[1];
this.initWebsockets();
if (data.content && data.content.search('metamask-sync:') !== -1) {
const result = data.content.replace('metamask-sync:', '').split('|@|');
this.channelName = result[0];
this.cipherKey = result[1];
this.initWebsockets();
} else {
Alert.alert(
strings('sync_with_extension.invalid_qr_code'),
strings('sync_with_extension.invalid_qr_code_desc')
);
}
}
});
};
Expand Down
15 changes: 11 additions & 4 deletions app/components/Views/SyncWithExtension/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,17 @@ class SyncWithExtension extends Component {
showQrCode = () => {
this.props.navigation.push('QRScanner', {
onScanSuccess: data => {
const result = data.content.replace('metamask-sync:', '').split('|@|');
this.channelName = result[0];
this.cipherKey = result[1];
this.initWebsockets();
if (data.content && data.content.search('metamask-sync:') !== -1) {
const result = data.content.replace('metamask-sync:', '').split('|@|');
this.channelName = result[0];
this.cipherKey = result[1];
this.initWebsockets();
} else {
Alert.alert(
strings('sync_with_extension.invalid_qr_code'),
strings('sync_with_extension.invalid_qr_code_desc')
);
}
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion ios/MetaMask/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.5</string>
<string>0.1.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
4 changes: 3 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,9 @@
"warning_title": "Warning!",
"warning_message": "This will override all your current accounts and transaction history in your mobile phone. Are you sure?",
"warning_ok_button": "YES",
"warning_cancel_button": "NO"
"warning_cancel_button": "NO",
"invalid_qr_code": "Invalid QR Code",
"invalid_qr_code_desc": "This isn't the right QR code! To sync with your browser extension, go to Settings --> Sync with Mobile in the browser extension and scan the QR there"
},
"sync_with_extension_success": {
"title": "Sync completed",
Expand Down
4 changes: 3 additions & 1 deletion locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@
"warning_title": "Advertencia!",
"warning_message": "Esto eliminará todas tus cuentas y historial de transactiones en tu dispositivo. Estás seguro?",
"warning_ok_button": "SI",
"warning_cancel_button": "NO"
"warning_cancel_button": "NO",
"invalid_qr_code": "Código QR inválido",
"invalid_qr_code_desc": "Este no es el código QR correcto! Para sincronizar con la extensión del navegador, accede a Ajustes --> Syncronizar con el móvil en la extensión del navegador y escanea el código QR que aparece ahí"
},
"sync_with_extension_success": {
"title": "Sincronización completa",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metamask",
"version": "0.1.5",
"version": "0.1.6",
"private": true,
"scripts": {
"restart-packager-clean": "watchman watch-del-all && rm -rf $TMPDIR/react-* && npm start -- --reset-cache",
Expand Down

0 comments on commit 8d3abe4

Please sign in to comment.