diff --git a/polygerrit-ui/app/elements/core/gr-error-manager/gr-error-manager.js b/polygerrit-ui/app/elements/core/gr-error-manager/gr-error-manager.js index f2b0d78610..7a9c4f92c7 100644 --- a/polygerrit-ui/app/elements/core/gr-error-manager/gr-error-manager.js +++ b/polygerrit-ui/app/elements/core/gr-error-manager/gr-error-manager.js @@ -100,6 +100,9 @@ this.listen(document, 'visibilitychange', '_handleVisibilityChange'); } this._requestCheckLoggedIn(); + if (!document.hidden) { + this._handleVisibilityChange(); + } }, _createToastAlert: function() { diff --git a/polygerrit-ui/app/elements/core/gr-error-manager/gr-error-manager_test.html b/polygerrit-ui/app/elements/core/gr-error-manager/gr-error-manager_test.html index 71774e345d..f633a7ee25 100644 --- a/polygerrit-ui/app/elements/core/gr-error-manager/gr-error-manager_test.html +++ b/polygerrit-ui/app/elements/core/gr-error-manager/gr-error-manager_test.html @@ -105,7 +105,7 @@ limitations under the License. var hideToastSpy = sandbox.spy(toast, 'hide'); - assert.isFalse(refreshStub.called); + assert.isTrue(refreshStub.called); element.flushDebouncer('checkLoggedIn'); flush(function() { assert.isTrue(refreshStub.called); 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 fda3021594..2f109c97af 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 @@ -251,7 +251,7 @@ }, refreshCredentials: function() { - this._cache['/accounts/self/detail'] = undefined; + this._cache = {}; return this.getLoggedIn(); },