diff --git a/assets/locales/en.json b/assets/locales/en.json index 36ee520c4..053436fb1 100644 --- a/assets/locales/en.json +++ b/assets/locales/en.json @@ -208,7 +208,7 @@ "message": "IPFS node has encountered an error and startup could not be completed:" }, "invalidRepositoryDialog": { - "title": "Invalid Repository", - "message": "The repository at { path } is invalid. The configuration file .ipfs/config must be a valid JSON file.\n\nBefore starting IPFS Desktop again, please fix the configuration file or rename the old repository to .ipfs.backup." + "title": "Invalid IPFS Repository or Configuration File", + "message": "The repository at “{ path }” is invalid. The “config” file must be a valid JSON.\n\nBefore starting IPFS Desktop again, please fix the configuration file or rename the old repository to “.ipfs.backup”." } } diff --git a/src/daemon/config.js b/src/daemon/config.js index 8010e28de..5042cf9d3 100644 --- a/src/daemon/config.js +++ b/src/daemon/config.js @@ -1,4 +1,4 @@ -const { app } = require('electron') +const { app, BrowserWindow } = require('electron') const { join } = require('path') const fs = require('fs-extra') const { multiaddr } = require('multiaddr') @@ -339,12 +339,20 @@ function checkValidConfig (ipfsd) { readConfigFile(ipfsd) return true } catch (e) { + // Save to error.log + logger.error(e) + + // Hide other windows so the user focus in on the dialog + BrowserWindow.getAllWindows().forEach(w => w.hide()) + + // Show blocking dialog showDialog({ title: i18n.t('invalidRepositoryDialog.title'), message: i18n.t('invalidRepositoryDialog.message', { path: ipfsd.path }), buttons: [i18n.t('quit')] }) + // Only option is to quit app.quit() } }