From f29ddba7f5703bec548c4602c5b8ebbbbd48857d Mon Sep 17 00:00:00 2001 From: AlexeyBarabash Date: Mon, 11 Apr 2022 16:13:55 +0300 Subject: [PATCH] Desktop sync setup shows different error messages --- .../brave_sync_page/brave_sync_code_dialog.html | 10 +++++----- .../brave_sync_page/brave_sync_code_dialog.js | 5 +++++ .../settings/brave_sync_page/brave_sync_setup.html | 1 + .../settings/brave_sync_page/brave_sync_setup.js | 12 ++++++------ 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.html b/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.html index 19cf6892c0a9..5585c3cc7a72 100644 --- a/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.html +++ b/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.html @@ -333,12 +333,12 @@

$i18n{braveSyncChooseDeviceComputerTitle}

+
diff --git a/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.js b/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.js index 78e2091a7fb0..04898ab31eeb 100644 --- a/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.js +++ b/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.js @@ -49,6 +49,11 @@ Polymer({ value: false, notify: true }, + syncCodeValidationResult: { + type: String, + value: '', + notify: true + }, syncCodeWordCount_: { type: Number, computed: 'computeSyncCodeWordCount_(syncCode)' diff --git a/browser/resources/settings/brave_sync_page/brave_sync_setup.html b/browser/resources/settings/brave_sync_page/brave_sync_setup.html index 97f87866b3d1..0c8dd5038658 100644 --- a/browser/resources/settings/brave_sync_page/brave_sync_setup.html +++ b/browser/resources/settings/brave_sync_page/brave_sync_setup.html @@ -63,6 +63,7 @@

$i18n{braveSyncSetupTitle}

code-type="{{syncCodeDialogType_}}" sync-code="{{syncCode}}" is-invalid-sync-code="{{isInvalidSyncCode_}}" + sync-code-validation-result="{{syncCodeValidationResult_}}" on-done="handleSyncCodeDialogDone_" > diff --git a/browser/resources/settings/brave_sync_page/brave_sync_setup.js b/browser/resources/settings/brave_sync_page/brave_sync_setup.js index ce48a71be533..32536c8e6b69 100644 --- a/browser/resources/settings/brave_sync_page/brave_sync_setup.js +++ b/browser/resources/settings/brave_sync_page/brave_sync_setup.js @@ -46,7 +46,11 @@ Polymer({ isInvalidSyncCode_: { type: Boolean, value: false, - } + }, + syncCodeValidationResult_: { + type: String, + value: '', + } }, /** @private {?BraveSyncBrowserProxy} */ @@ -87,13 +91,9 @@ Polymer({ const syncCodeToSubmit = this.syncCode || '' let success = false try { - console.log('submitSyncCode_ 001') success = await this.syncBrowserProxy_.setSyncCode(syncCodeToSubmit) - console.log('submitSyncCode_ 002') } catch (e) { - console.log('submitSyncCode_ 003++, e=', e) - console.error("Error setting sync code") - alert(e) + this.syncCodeValidationResult_ = e success = false } this.isSubmittingSyncCode_ = false