Skip to content

Commit

Permalink
Merge pull request MyEtherWallet#2400 from MyEtherWallet/bug/sentry-f…
Browse files Browse the repository at this point in the history
…ixes-y

Bug/sentry fixes y [v5]
  • Loading branch information
gamalielhere authored May 27, 2020
2 parents bd54d15 + 128f7b6 commit f88e547
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 32 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
### Devop

- Fix MEW CX build [#2403](https://github.com/MyEtherWallet/MyEtherWallet/pull/2403)
### Release v5.6.3

### Bug

- Sentry fixes y [#2400](https://github.com/MyEtherWallet/MyEtherWallet/pull/2400)
- Sentry fixes j [#2396](https://github.com/MyEtherWallet/MyEtherWallet/pull/2396)
- Fix address not getting returned for unable to validate addresses and disable swap when recalculating rates[#2397](https://github.com/MyEtherWallet/MyEtherWallet/pull/2397)
- Fix errors from sentry [#2393](https://github.com/MyEtherWallet/MyEtherWallet/pull/2393)
Expand All @@ -12,6 +11,7 @@

### Devop

- Fix MEW CX build [#2403](https://github.com/MyEtherWallet/MyEtherWallet/pull/2403)
- Update terms of service [#2394](https://github.com/MyEtherWallet/MyEtherWallet/pull/2394)
- Fix sentry releases [#2395](https://github.com/MyEtherWallet/MyEtherWallet/pull/2395)

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "myetherwallet",
"version": "5.6.2",
"version": "5.6.3",
"description": "Client side ethereum wallet",
"scripts": {
"build:offline": "WEBPACK_INTEGRITY=false npm run build:hash",
Expand Down
1 change: 1 addition & 0 deletions src/builds/mewcx/cxHelpers/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { isAddress, toChecksumAddress } from '@/helpers/addressUtils';
import Misc from '@/helpers/misc';
import { extractRootDomain } from './extractRootDomain';
import MiddleWare from '@/wallets/web3-provider/middleware';
import localStorage from 'store';
import {
mewCxFetchAccounts,
mewCxSignTx,
Expand Down
4 changes: 2 additions & 2 deletions src/dapps/ManageENS/ManageENS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default {
);
},
parsedTld() {
if (this.parsedHostName.length) {
if (this.parsedHostName && this.parsedHostName.length) {
const hasTld = this.domainName.lastIndexOf('.');
return hasTld > -1
? this.domainName.substr(hasTld + 1, this.domainName.length)
Expand All @@ -190,7 +190,7 @@ export default {
return '';
},
parsedHostName() {
if (this.domainName.length) {
if (this.domainName && this.domainName.length) {
return this.domainName.substr(
0,
this.domainName.lastIndexOf('.') > -1
Expand Down
1 change: 1 addition & 0 deletions src/dapps/ManageENS/supportedCoins.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class MValidator {
this.type = type;
}
validate(address) {
if (!address) return false;
return MultiCoinValidator.validate(address, this.type);
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/dapps/ManageENS/supportedTxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const isUrl = function (input) {
};

const isEmail = function (input) {
if (!input) return;
if (!input) return false;
const atIndex = input.indexOf('@');
const parsedEmailName = normalise(input.substr(0, atIndex));
const parsedEmailHost = normalise(input.substr(atIndex + 1, input.length));
Expand All @@ -23,12 +23,13 @@ const isEmail = function (input) {
};

const isString = function (input) {
if (!input) return false;
const parsedInput = normalise(input);
return typeof parsedInput === 'string';
};

const isHandle = function (input) {
if (!input) return;
if (!input) return false;
const atIndex = input.indexOf('@');
const parsedInput = normalise(input.substr(atIndex + 1, input.length));
if (!isString(parsedInput)) return false;
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const toBuffer = v => {
const capitalize = value => {
if (!value) return '';
value = value.toString();
return value.charAt(0).toUpperCase() + value.slice(1);
return value.charAt(0).toUpperCase() + value.substr(1, value.length);
};
/* Accepts string, returns boolean */
const isJson = str => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,20 @@ export default {
};
},
mounted() {
isSupported().then(res => {
this.items.forEach(item => {
const u2fhw = [BITBOX_TYPE];
isSupported()
.then(res => {
this.items.forEach(item => {
const u2fhw = [BITBOX_TYPE];
if (u2fhw.includes(item.name)) {
item.disabled = !res;
item.msg = !res ? 'errorsGlobal.browser-non-u2f' : '';
}
if (u2fhw.includes(item.name)) {
item.disabled = !res;
item.msg = !res ? 'errorsGlobal.browser-non-u2f' : '';
}
});
})
.catch(e => {
BitBox02Wallet.errorHandler(e);
});
});
this.$refs.bitboxSelect.$on('hidden', () => {
this.selected = '';
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import printJS from 'print-js';
import html2canvas from 'html2canvas';
import MnemonicTableToPrint from './components/MnemonicTableToPrint';
import MnemonicTableToDisplay from './components/MnemonicTableToDisplay';
import { Toast } from '@/helpers';
export default {
components: {
Expand Down Expand Up @@ -72,20 +73,25 @@ export default {
},
methods: {
async print() {
const element = this.$refs.printContainer;
const screen = await html2canvas(element, {
async: true,
logging: false,
height: 800,
width: 800,
scrollY: 0
}).then(canvas => {
return canvas;
});
printJS({
printable: screen.toDataURL('image/png'),
type: 'image'
});
try {
const element = this.$refs.printContainer;
const screen = await html2canvas(element, {
async: true,
logging: false,
height: 800,
width: 800,
scrollY: 0
});
printJS({
printable: screen.toDataURL('image/png'),
type: 'image'
});
} catch (e) {
Toast.responseHandler(
this.$t('errorsGlobal.print-support-error'),
Toast.ERROR
);
}
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ import { Misc, Toast } from '@/helpers';
import { isAddress } from '@/helpers/addressUtils';
import * as unit from 'ethjs-unit';
import store from 'store';
import BigNumber from 'bignumber.js';
export default {
components: {
Expand Down Expand Up @@ -340,6 +341,9 @@ export default {
_contractArgs.push(parsedItem);
} else if (item.type === 'address') {
_contractArgs.push(this.inputs[item.name].toLowerCase().trim());
} else if (item.includes === 'uint') {
const number = new BigNumber(this.inputs[item.name].trim());
_contractArgs.push(number.toFixed());
} else {
_contractArgs.push(this.inputs[item.name]);
}
Expand Down
1 change: 1 addition & 0 deletions src/translations/errors-global/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"signer-address-different": "Signer address is different from the derived address!",
"high-gas-limit-warning": "Warning: High gas prices mean higher transaction fees.",
"invalid-network-id-sig": "Invalid networkId signature returned. Expected: {expected}, Got: {got}",
"print-support-error": "Print isn't supported or browser does not support print",
"network-error": "No network connection please make sure you are connected",
"browser-not-supported": "Browser not compliant. Try using Chrome or Opera!"
}
1 change: 1 addition & 0 deletions src/wallets/web3-provider/methods/eth_coinbase.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { toPayload } from '../jsonrpc';
export default async ({ payload, store }, res, next) => {
if (payload.method !== 'eth_coinbase') return next();
if (!store.state.wallet) res(null, toPayload(payload.id, null));
res(null, toPayload(payload.id, store.state.wallet.getAddressString()));
};

0 comments on commit f88e547

Please sign in to comment.