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

Fix Mist startup crash due to about:blank page #548

Merged
merged 1 commit into from
May 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions interface/client/appStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@ The init function of Mist
@method mistInit
*/
mistInit = function(){

console.log('Initialise Mist');

Meteor.setTimeout(function() {
if (0 <= location.search.indexOf('reset-tabs')) {
console.log('Resetting UI tabs');

Tabs.remove({});
}

if(!Tabs.findOne('browser')) {
Tabs.insert({
_id: 'browser',
url: 'about:blank',
url: 'https://ethereum.org',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will change this to the app catalog when we have one

position: 0
});

Tabs.insert({
url: 'http://ethereum-dapp-wallet.meteor.com',
position: 1,
position: 0,
permissions: {
accounts: web3.eth.accounts
}
Expand All @@ -41,14 +47,15 @@ mistInit = function(){


Meteor.startup(function(){
console.log('Meteor starting up');

// check that it is not syncing before
web3.eth.getSyncing(function(e, sync) {
if(e || !sync)
mistInit();
});



// SET default language
if(Cookie.get('TAPi18next')) {
TAPi18n.setLanguage(Cookie.get('TAPi18next'));
Expand Down
9 changes: 8 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const argv = require('yargs')
.describe('gethpath', 'Path to geth executable to use instead of default')
.describe('ethpath', 'Path to eth executable to use instead of default')
.describe('ignore-gpu-blacklist', 'Ignores GPU blacklist (needed for some Linux installations)')
.describe('reset-tabs', 'Reset Mist tabs to their default settings')
.describe('logfile', 'Logs will be written to this file')
.describe('loglevel', 'Minimum logging threshold: trace (all logs), debug, info (default), warn, error')
.alias('m', 'mode')
Expand Down Expand Up @@ -110,9 +111,15 @@ if(global.mode === 'wallet') {
} else {
log.info('Starting in Mist mode');

global.interfaceAppUrl = global.interfacePopupsUrl = (global.production)
let url = (global.production)
? 'file://' + __dirname + '/interface/index.html'
: 'http://localhost:3000';

if (argv.resetTabs) {
url += '?reset-tabs=true'
}

global.interfaceAppUrl = global.interfacePopupsUrl = url;
}


Expand Down