Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4606)

Unified Diff: chrome/browser/resources/settings/people_page/people_page.js

Issue 2498013003: MD Settings: Suppress the signout dialog if user is not signed in. (Closed)
Patch Set: solve flakiness Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/people_page_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/people_page/people_page.js
diff --git a/chrome/browser/resources/settings/people_page/people_page.js b/chrome/browser/resources/settings/people_page/people_page.js
index a2a61b843133325e1f3f45d0a87edd745be30545..86cfb384c3e2f799f89f9127d3026615f19a56ed 100644
--- a/chrome/browser/resources/settings/people_page/people_page.js
+++ b/chrome/browser/resources/settings/people_page/people_page.js
@@ -142,10 +142,17 @@ Polymer({
/** @protected */
currentRouteChanged: function() {
- if (settings.getCurrentRoute() == settings.Route.SIGN_OUT)
- this.$.disconnectDialog.showModal();
- else if (this.$.disconnectDialog.open)
+ if (settings.getCurrentRoute() == settings.Route.SIGN_OUT) {
+ // If the sync status has not been fetched yet, optimistically display
+ // the disconnect dialog. There is another check when the sync status is
+ // fetched. The dialog will be closed then the user is not signed in.
+ if (this.syncStatus && !this.syncStatus.signedIn)
+ settings.navigateToPreviousRoute();
+ else
+ this.$.disconnectDialog.showModal();
+ } else if (this.$.disconnectDialog.open) {
this.$.disconnectDialog.close();
+ }
},
<if expr="chromeos">
@@ -184,9 +191,12 @@ Polymer({
* @private
*/
handleSyncStatus_: function(syncStatus) {
- if (!this.syncStatus && syncStatus && !syncStatus.signedIn) {
+ if (!this.syncStatus && syncStatus && !syncStatus.signedIn)
chrome.metricsPrivate.recordUserAction('Signin_Impression_FromSettings');
- }
+
+ if (!syncStatus.signedIn && this.$.disconnectDialog.open)
+ this.$.disconnectDialog.close();
+
this.syncStatus = syncStatus;
},
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/people_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698