Skip to content

Checked status not updating on state change through xmlhttprequest listener #162

@kaushalvivek

Description

@kaushalvivek
checkDeploymentStatus(modelId) {
   var xhr = new XMLHttpRequest()
   xhr.addEventListener('load', () => {
     if (xhr.responseText ==="deployed") {
       this.setState({
         isModelDeployed: true,
         modelInferenceAPI: MODEL_INFERENCE_API+'/'+this.props.modelVersion.run_id,
       });
     }
     else {
       this.setState({
         isModelDeployed: false,
         modelInferenceAPI: "Nor Deployed",
       });
     }
   });
   xhr.open('GET',MODEL_DEPLOYMENT_URL+"?runId="+modelId)
   xhr.send()
 }

This would update the state, but the state would not be reflected in the toggle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions