I am updating a task property through a request to my backend for an assigned task, this request is made on a custom component, on a button click during the call.
I can see in my twilio console that the update went fine and the new value is shown there, but the task prop on my flex components are not being updated, maintaining the same attributes since the assignment.
Is there a way to "refresh" the task in flex? I would need this updated attribute in order to perform a conditional rendering on my custom component.
Thanks in advance to anyone that helps me out.
import React from 'react';
import { withTaskContext } from '@twilio/flex-ui';
class IsRecording extends React.Component {
constructor(props) {
super(props);
}
render() {
// this.task = this.props.tasks
return (
<div>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#E50000">
<path
d="M16 16c0 1.104-.896 2-2 2h-12c-1.104 0-2-.896-2-2v-8c0-1.104.896-2 2-2h12c1.104 0 2 .896 2 2v8zm8-10l-6 4.223v3.554l6 4.223v-12z"/>
<animate
attributeType="XML"
attributeName="fill"
values="#800;#f00;#800;#800"
dur="1.5s"
repeatCount="indefinite"/>
</svg>
</div>
)
}
};
export default withTaskContext(IsRecording);