Fix react videochat component

This commit is contained in:
icwizardmonke 2023-09-17 16:51:09 +00:00
parent 683c9bd417
commit e6f1760ff5
5 changed files with 8 additions and 8 deletions

View File

@ -35,7 +35,7 @@ guard :bundler do
files.each { |file| watch(helper.real_path(file)) }
end
guard 'rails', host: '0.0.0.0', port: 9913 do
guard 'rails', host: '0.0.0.0', port: 9914 do
watch('Gemfile.lock')
watch(%r{^(config|lib)/.*})
end

File diff suppressed because one or more lines are too long

View File

@ -6,8 +6,8 @@
//= require_tree ./channels
(function() {
this.App || (this.App = {});
this.VideoCall || (this.VideoCall = {});
App.cable = ActionCable.createConsumer();
VideoCall.cable = ActionCable.createConsumer();
}).call(this);

View File

@ -1,3 +1,3 @@
%main#root
%h1 If you're seeing this, something broke
%h1 react component failed to load
-# , props = {id: @game.id, current_user: current_user}, html_options = {id: "game-component-container"}

View File

@ -22,7 +22,7 @@ class VideoCall extends React.Component{
joinCall(e){
console.log("Hello from joinCall");
console.log(e);
App.cable.subscriptions.create(
VideoCall.cable.subscriptions.create(
{ channel: "CallChannel" },
{
connected: () => {
@ -130,7 +130,7 @@ class VideoCall extends React.Component{
.forEach(function (track) { track.stop(); })
this.localVideo.srcObject = null;
App.cable.subscriptions.subscriptions = [];
VideoCall.cable.subscriptions.subscriptions = [];
this.remoteVideoContainer.innerHTML = "";
broadcastData({ type: LEAVE_CALL, from: this.userId });
}
@ -150,4 +150,4 @@ class VideoCall extends React.Component{
</div>)
}
}
export default App;
export default VideoCall;