diff --git a/lib/utils.jsx b/lib/utils.jsx index 1c0db48..72851c8 100644 --- a/lib/utils.jsx +++ b/lib/utils.jsx @@ -142,7 +142,7 @@ var createTaskClusterMixin = (options) => { handleCredentialsChanged(e) { // Update clients with new credentials this._createClients(e.detail); - + this.setState({ createdTaskIdError: null }); if (options.reloadOnLogin) { // Reload state now that we have new credentials @@ -307,10 +307,10 @@ var createTaskClusterMixin = (options) => { return ( loggedOut403 ? ( - +

You are not authorized to perform the requested action. Please sign in and try again.

- ) : ( + ) : ( {code}  @@ -373,6 +373,8 @@ exports.createTaskClusterMixin = createTaskClusterMixin; * listening: true || false || null // null when connecting * } * And calls `this.handleMessage(message)` when a message arrives. + * When listening is started `this.listening()` will be called if it is + * implemented. */ var createWebListenerMixin = (options) => { // Set default options @@ -491,6 +493,9 @@ var createWebListenerMixin = (options) => { listening: true, listeningError: undefined }); + if (this.listening instanceof Function) { + this.listening(); + } }, err => { debug("Error while listening: %s, %j", err, err); if (!err) { @@ -514,6 +519,9 @@ var createWebListenerMixin = (options) => { listening: true, listeningError: undefined }); + if (this.listening instanceof Function) { + this.listening(); + } }, err => { debug("Error while listening: %s, %j", err, err); if (!err) { diff --git a/one-click-loaner/connect/connect.jsx b/one-click-loaner/connect/connect.jsx index c8fba68..0a62e7c 100644 --- a/one-click-loaner/connect/connect.jsx +++ b/one-click-loaner/connect/connect.jsx @@ -92,6 +92,12 @@ let Connect = React.createClass({ ]; }, + listening() { + this.queue.listLatestArtifacts(this.state.taskId).then(result => { + result.artifacts.forEach(a => this.processArtifact(a, false)); + }).catch(err => console.log("Failed to list artifacts: ", err)); + }, + handleMessage(message) { // Update status structure this.setState({ @@ -289,4 +295,4 @@ let Connect = React.createClass({ }); // Export Connect -module.exports = Connect; \ No newline at end of file +module.exports = Connect;