Skip to content

Commit

Permalink
Enables to skip tine syncing check
Browse files Browse the repository at this point in the history
  • Loading branch information
evertonfraga committed Oct 9, 2017
1 parent 0440db7 commit 6a3c643
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
37 changes: 18 additions & 19 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,26 +270,25 @@ onReady = () => {
});
}

// check time sync
// var ntpClient = require('ntp-client');
// ntpClient.getNetworkTime("pool.ntp.org", 123, function(err, date) {
timesync.checkEnabled((err, enabled) => {
if (err) {
log.error('Couldn\'t get time from NTP time sync server.', err);
return;
}

if (!enabled) {
dialog.showMessageBox({
type: 'warning',
buttons: ['OK'],
message: global.i18n.t('mist.errors.timeSync.title'),
detail: `${global.i18n.t('mist.errors.timeSync.description')}\n\n${global.i18n.t(`mist.errors.timeSync.${process.platform}`)}`,
}, () => {
});
}
});
// Checks time sync
if (!Settings.skiptimesynccheck) {
timesync.checkEnabled((err, enabled) => {
if (err) {
log.error('Couldn\'t infer if computer automatically syncs time.', err);
return;
}

if (!enabled) {
dialog.showMessageBox({
type: 'warning',
buttons: ['OK'],
message: global.i18n.t('mist.errors.timeSync.title'),
detail: `${global.i18n.t('mist.errors.timeSync.description')}\n\n${global.i18n.t(`mist.errors.timeSync.${process.platform}`)}`,
}, () => {
});
}
});
}

const kickStart = () => {
// client binary stuff
Expand Down
13 changes: 12 additions & 1 deletion modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ const argv = require('yargs')
group: 'Mist options:',
type: 'boolean',
},
skiptimesynccheck: {
demand: false,
requiresArg: false,
nargs: 0,
describe: 'Disable checks for the presence of automatic time sync on your OS.',
group: 'Mist options:',
type: 'boolean',
},
'': {
describe: 'To pass options to the underlying node (e.g. Geth) use the --node- prefix, e.g. --node-datadir',
group: 'Node options:',
Expand All @@ -141,7 +149,6 @@ const argv = require('yargs')
.alias('h', 'help')
.parse(process.argv.slice(1));


argv.nodeOptions = [];

for (const optIdx in argv) {
Expand Down Expand Up @@ -304,6 +311,10 @@ class Settings {
this.saveConfig('ui.i18n', langCode);
}

get skiptimesynccheck() {
return argv.skiptimesynccheck;
}

initConfig() {
global.config.insert({
ui: {
Expand Down

0 comments on commit 6a3c643

Please sign in to comment.