镜像问题websocket传值

镜像问题websocket传值
This commit is contained in:
caishi 2021-08-19 17:44:13 +08:00
commit 313f1edc71
1 changed files with 7 additions and 3 deletions

View File

@ -225,7 +225,7 @@ class Detail extends Component {
if(num){
this.setState({
secondSync:true,
firsrtSync:false
firstSync:false
})
}else{
this.setState({
@ -236,7 +236,7 @@ class Detail extends Component {
}else{
this.getDetail();
this.setState({
firsrtSync:false,
firstSync:false,
secondSync:false
})
}
@ -257,7 +257,7 @@ class Detail extends Component {
var cable = actioncable.createConsumer(`wss://${name}/cable`);
this.canvasChannel1 = cable.subscriptions.create({
channel: `MirrorProjectChannel`,
id: project && project.identifier
id: project && project.id
}, {
connected: () => {
console.log("###### channel connected! ######");
@ -267,6 +267,10 @@ class Detail extends Component {
console.log(`###### ---received data--- ######`);
if (data) {
this.getDetail();
this.setState({
firstSync:false,
secondSync:false
});
cable.subscriptions.consumer.disconnect();
}
}