Fix empty Registered field on settings screen

Registered field is stored in account object. Account object is stored
in cache and it is set with first restApi invocation. During the login
process, not all account fields are set but cache entry is set. This
cache needs to be updated when settings screen is open.

Bug: Issue 14600
Change-Id: I4cc1233868c9fafa1035983be14be1b304a348ee
diff --git a/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js b/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js
index 7e312d3..b1b5ba7 100644
--- a/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js
+++ b/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js
@@ -102,6 +102,8 @@
       this._serverConfig = config;
     }));
 
+    promises.push(this.$.restAPI.invalidateAccountsDetailCache());
+
     promises.push(this.$.restAPI.getAccount().then(account => {
       this._hasNameChange = false;
       this._hasUsernameChange = false;
diff --git a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js
index b675df7..72c8058 100644
--- a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js
+++ b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js
@@ -1349,6 +1349,10 @@
     this._restApiHelper.invalidateFetchPromisesPrefix('/accounts/');
   }
 
+  invalidateAccountsDetailCache() {
+    this._restApiHelper.invalidateFetchPromisesPrefix('/accounts/self/detail');
+  }
+
   /**
    * @param {string} filter
    * @param {number} groupsPerPage