diff --git a/app/extensions.js b/app/extensions.js index e2f08f0acf6..9c525799806 100644 --- a/app/extensions.js +++ b/app/extensions.js @@ -225,15 +225,18 @@ let generateSyncManifest = () => { 'default-src': '\'self\'', 'form-action': '\'none\'' } - cspDirectives['connect-src'] = ['\'self\'', - appConfig.sync.serverUrl, - appConfig.sync.s3Url].join(' ') + const connectSources = ['\'self\'', appConfig.sync.serverUrl, appConfig.sync.s3Url] + if (process.env.NODE_ENV === 'development') { + connectSources.push(appConfig.sync.testS3Url) + } + + cspDirectives['connect-src'] = connectSources.join(' ') if (process.env.NODE_ENV === 'development') { // allow access to webpack dev server resources let devServer = 'localhost:' + process.env.npm_package_config_port cspDirectives['default-src'] += ' http://' + devServer - cspDirectives['connect-src'] += ' http://' + devServer + ' ws://' + devServer + ' ' + appConfig.sync.testS3Url + cspDirectives['connect-src'] += ' http://' + devServer + ' ws://' + devServer } return { diff --git a/app/extensions/brave/locales/en-US/app.properties b/app/extensions/brave/locales/en-US/app.properties index dc6b6694572..97a698bc4c8 100644 --- a/app/extensions/brave/locales/en-US/app.properties +++ b/app/extensions/brave/locales/en-US/app.properties @@ -257,3 +257,5 @@ rememberThisDecision=Remember this decision for {{origin}} copyToClipboard.title=Copy to clipboard preventMoreAlerts=Prevent this page from creating additional dialogs copied=Copied! +connectionError=Server connection failed. Please make sure you are connected to the Internet. +unknownError=Oops, something went wrong. diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index 70385eb8d24..23eb682169e 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -40,6 +40,7 @@ syncNewDevice=Sync a new device… syncClearProfile=Sync a new device… syncClearData=Clear Data syncResetButton=Reset Sync… +syncRetryButton=Try again syncResetDataDisabled=This feature is only available when Sync is enabled. syncReset=Reset Sync syncResetMessageWhat=Resetting Sync clears data stored on the Sync server and resets this device's Sync settings. diff --git a/app/locale.js b/app/locale.js index 80c94997186..22346ee83b9 100644 --- a/app/locale.js +++ b/app/locale.js @@ -239,7 +239,9 @@ var rendererIdentifiers = function () { 'importSuccess', 'licenseTextOk', 'closeFirefoxWarningOk', - 'importSuccessOk' + 'importSuccessOk', + 'connectionError', + 'unknownError' ] } diff --git a/app/renderer/components/preferences/syncTab.js b/app/renderer/components/preferences/syncTab.js index 1cc42b14997..3c423d1c632 100644 --- a/app/renderer/components/preferences/syncTab.js +++ b/app/renderer/components/preferences/syncTab.js @@ -27,14 +27,25 @@ class SyncTab extends ImmutableComponent { this.enableRestore = this.enableRestore.bind(this) } + get setupError () { + return this.props.syncData.get('setupError') + } + get isSetup () { - return this.props.syncData.get('seed') instanceof Immutable.List && this.props.syncData.get('seed').size === 32 + return !this.setupError && this.props.syncData.get('seed') instanceof Immutable.List && this.props.syncData.get('seed').size === 32 } get enabled () { return getSetting(settings.SYNC_ENABLED, this.props.settings) } + get errorContent () { + return
+
{this.setupError}
+
+ } + get clearDataContent () { return
@@ -50,6 +61,9 @@ class SyncTab extends ImmutableComponent { } get setupContent () { + if (this.setupError) { + return null + } // displayed before a sync userId has been created return