Chromium Code Reviews| Index: appengine/config_service/ui/src/config-ui/front-page.html |
| diff --git a/appengine/config_service/ui/src/config-ui/front-page.html b/appengine/config_service/ui/src/config-ui/front-page.html |
| index b7d31a9c9827edac319b2eb3557510df83087874..64ae2e82b4f85faaa93d8bfa58b51f697972ba90 100644 |
| --- a/appengine/config_service/ui/src/config-ui/front-page.html |
| +++ b/appengine/config_service/ui/src/config-ui/front-page.html |
| @@ -48,7 +48,6 @@ |
| </style> |
| <iron-ajax |
| - auto |
| id="requestConfigs" |
| url="/_ah/api/config/v1/config-sets?include_last_import_attempt=true" |
| handle-as="json" |
| @@ -108,6 +107,37 @@ |
| searchResults: { |
| type: Array, |
| value: () => [] |
| + }, |
| + |
| + user: { |
| + type: Object, |
| + value: () => null, |
| + notify: true, |
| + observer: '_fetchConfigs' |
| + } |
| + }, |
| + |
| + _fetchConfigs: function() { |
| + // If the google auth API has been initialized, |
| + // and the user is not signed in, then generate the |
| + // ajax request. If the google auth API has been |
| + // initialized, and the user is signed in, we wait for |
| + // the auth headers to be set, and then generate the |
| + // ajax request to get the config sets. |
| + if (this.initialized && this.user) { |
| + if (this.user.getBasicProfile()){ |
| + window.setTimeout(function() { |
|
Ryan Tseng
2017/07/14 18:52:30
Can we bind to and event where the auth_header bei
|
| + if (this.auth_headers) { |
| + this.isLoading = true; |
| + this.$.requestConfigs.generateRequest(); |
| + } else { |
| + this._fetchConfigs.bind(this); |
| + } |
| + }.bind(this), 50); |
| + } else { |
| + this.isLoading = true; |
| + this.$.requestConfigs.generateRequest(); |
| + } |
| } |
| }, |