Skip to content
This repository was archived by the owner on Sep 5, 2020. It is now read-only.

Commit 16a9e07

Browse files
evertonfragafrozeman
authored andcommitted
Develop into master (#2804)
* improve 'METHOD_DENIED' error message (#2127) * improve 'METHOD_DENIED' error message * fix * upstream fixes * Swarm additions (#2764) * fixes batch requests on isolated preloaders * added 404 page for not found swarm content * fixed coide climate issues * show custom 404 error only for bzz:// * Error page fixes and build errors (#2780) * fixes batch requests on isolated preloaders * added 404 page for not found swarm content * fixed coide climate issues * show custom 404 error only for bzz:// * fixed borwser.js issue and sound and error pages * trigger travis * trigger travis * adding globals to ESLint whitelist * Small refactor; Fixing 3/4 tests * Adjusting spectron version * ESLint * [Spectron] New fixture server; Fixes 4/4 test. * Wallet shouldn't start Swarm * Wallet shouldn't start Swarm * Adding exception to eslint * Fix wallet preloader issue * Mac release path (#2808) * Adding gitter channel info (#2807) * Add bzz and .eth to urls (#2792) * add .eth * refactor ifs * solve for wallet.ethereum.org * Fixing delay problem
1 parent 147a87b commit 16a9e07

File tree

20 files changed

+173
-116
lines changed

20 files changed

+173
-116
lines changed

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ globals: # don't warn about missing declarations
4444
_: true
4545
window: true
4646
location: true
47-
47+
document: true

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ Please note that this repository is the Electron host for the Meteor based walle
1212

1313
## Help and troubleshooting
1414

15-
Please check the [Mist troubleshooting guide](https://github.com/ethereum/mist/wiki) for help.
15+
Please check the [Mist troubleshooting guide](https://github.com/ethereum/mist/wiki).
16+
17+
Or the [Gitter Channel](https://gitter.im/ethereum/mist), to connect with the community for instant help.
1618

1719
## Installation
1820

gulpTasks/building.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ gulp.task('copy-app-source-files', () => {
3535
'!./tests/wallet/*',
3636
`./icons/${type}/*`,
3737
'./sounds/*',
38+
'./errorPages/*',
3839
'customProtocols.js'
3940
], {
4041
base: './'
@@ -214,7 +215,8 @@ gulp.task('release-dist', (done) => {
214215
break;
215216
case 'mac':
216217
cp(
217-
`${applicationName}-${version}.dmg`, `${appNameHypen}-macosx-${versionDashed}.dmg`);
218+
path.join('mac', `${applicationName}-${version}.dmg`),
219+
`${appNameHypen}-macosx-${versionDashed}.dmg`);
218220
break;
219221
case 'linux':
220222
cp(

gulpTasks/publishing.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ gulp.task('upload-binaries', (cb) => {
5757
// personal access token (public_repo) must be set using travis' ENVs
5858
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
5959

60+
console.info('Checking Github releases...');
61+
6062
// query github releases
6163
got(`https://api.github.com/repos/ethereum/mist/releases?access_token=${GITHUB_TOKEN}`, { json: true })
6264
// filter draft with current version's tag

interface/client/lib/helpers/helperFunctions.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,19 @@ Format Urls, e.g add a default protocol if on is missing.
7979
@param {String} url
8080
**/
8181
Helpers.formatUrl = function (url) {
82+
if (!url) return;
83+
8284
// add http:// if no protocol is present
83-
if (url && url.length === 64 && !!url.match(/^[0-9a-f]+$/)) {
85+
if (url.length === 64 && !!url.match(/^[0-9a-f]+$/)) {
8486
// if the url looks like a hash, add bzz
8587
url = 'bzz://' + url;
86-
} else if (url && url.indexOf('://') === -1) {
88+
} else if (!!url.match(/^([a-z]*:\/\/)?[^/]*\.eth(\/.*)?$/i)) {
89+
// if uses .eth as a TLD
90+
url = 'bzz://' + url.replace(/^([a-z]*:\/\/)?/i, '');
91+
} else if (!!url.match(/^[^\.\/]*$/i)) {
92+
// doesn't have a protocol nor a TLD
93+
url = 'bzz://' + url + '.eth';
94+
} else if (url.indexOf('://') === -1) {
8795
// if it doesn't have a protocol
8896
url = 'http://' + url;
8997
}

interface/client/mistAPIBackend.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ mistAPIBackend = function (event) {
6767
appBar: (_.contains(allowedBrowserBarStyles, appBarClass) ? appBarClass : null)
6868
}});
6969
}
70-
7170
if (event.channel === 'mistAPI_sound') {
7271
sound.pause();
73-
sound.src = Blaze._escape(arg);
72+
sound.src = Blaze._escape('file://'+ dirname +'/sounds/' + arg + '.mp3');
7473
sound.play();
7574
}
7675

interface/client/templates/views/webview.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ Template['views_webview'].onRendered(function () {
6464
webview.addEventListener('did-fail-load', showError.bind(webview, tabId));
6565
webview.addEventListener('crashed', showError.bind(webview, tabId));
6666

67+
// Forward SWARM status code errors to showError
68+
webview.addEventListener('did-get-response-details', function (e) {
69+
if (e && e.resourceType === 'mainFrame' && /^bzz:\//i.test(e.newURL)) {
70+
switch (e.httpResponseCode) {
71+
case 500:
72+
showError.call(webview, tabId, {
73+
isMainFrame: true,
74+
errorCode: 404
75+
});
76+
break;
77+
}
78+
}
79+
});
80+
81+
6782
// navigate page, and redirect to browser tab if necessary
6883
webview.addEventListener('will-navigate', webviewLoadStart.bind(webview, tabId));
6984
webview.addEventListener('did-get-redirect-request', webviewLoadStart.bind(webview, tabId));

interface/client/templates/webviewEvents.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ showError = function (tabId, e) {
1212
case -105:
1313
url = path + '404.html';
1414
break;
15+
case 404:
16+
url = path + '404.html';
17+
break;
1518
case 500:
1619
url = path + '500.html';
1720
break;
@@ -41,7 +44,7 @@ webviewChangeUrl = function (tabId, e) {
4144
}
4245

4346
// make sure to not store error pages in history
44-
if (!url || url.indexOf('mist/errorPages/') !== -1) {
47+
if (!url || url.indexOf('mist/errorPages/') !== -1 || url.indexOf('app.asar/errorPages/') !== -1) {
4548
return;
4649
}
4750

interface/i18n/mist.en.i18n.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@
8181
},
8282
"help": {
8383
"label": "Help",
84-
"reportBug": "Report an issue on Github",
85-
"mistWiki": "Troubleshooting and Help"
84+
"mistWiki": "Troubleshooting and Help",
85+
"gitter": "Mist channel on Gitter",
86+
"reportBug": "Report an issue on Github"
8687
}
8788
},
8889
"errors": {

main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ onReady = () => {
381381
return ethereumNode.init();
382382
})
383383
.then(() => {
384+
// Wallet shouldn't start Swarm
385+
if (Settings.uiMode === 'wallet') {
386+
return Promise.resolve();
387+
}
384388
return swarmNode.init();
385389
})
386390
.then(function sanityCheck() {

0 commit comments

Comments
 (0)