summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrzemyslaw Waliszewski <pwaliszewski@gmail.com>2021-05-25 22:26:59 +0200
committerPrzemyslaw Waliszewski <pwaliszewski@gmail.com>2021-05-26 13:21:33 +0000
commit9942ad72d7330720c4ba7b54218d098a7cdbecb2 (patch)
tree14b4ae9f718ef3a78e5fe26677dd316770ee4783
parent8977bc660abccb055ee75145a618507dba1b2cdf (diff)
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
-rw-r--r--polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.js2
-rw-r--r--polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js4
2 files changed, 6 insertions, 0 deletions
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 7e312d32e6..b1b5ba790e 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 @@ class GrAccountInfo extends GestureEventListeners(
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 b675df71a0..72c805855c 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 @@ class GrRestApiInterface extends mixinBehaviors( [
this._restApiHelper.invalidateFetchPromisesPrefix('/accounts/');
}
+ invalidateAccountsDetailCache() {
+ this._restApiHelper.invalidateFetchPromisesPrefix('/accounts/self/detail');
+ }
+
/**
* @param {string} filter
* @param {number} groupsPerPage