added autoclick on join room
This commit is contained in:
parent
fbde469f45
commit
a7d4422f3a
|
@ -26,17 +26,11 @@ App.cable.subscriptions.create({
|
|||
// console.log(data.body)
|
||||
if (data.head === 302 && data.body["caller"] === userId && data.path) {
|
||||
window.location.pathname = data.path
|
||||
} else if (data["message"]["user_id"] === userId) {
|
||||
} else if (data["message"]["user_id"] === userId) { // Some error appears here but it is not fatal
|
||||
console.log("TRIGGER MODAL")
|
||||
const acceptButton = document.getElementById('accept-button')
|
||||
acceptButton.style.display = "block"
|
||||
// const receiveCall = document.getElementById('receive-call')
|
||||
// receiveCall.dataset.toggle = 'modal'
|
||||
// receiveCall.dataset.target ='#calleeModal'
|
||||
// console.log(receiveCall)
|
||||
|
||||
// const calleeModal = document.getElementById('calleeModal')
|
||||
// calleeModal.modal("show")
|
||||
chatRoomId = data["message"]["chat_room_id"]
|
||||
console.log(`user with id: ${userId} needs to subscribe to chatroom ${[chatRoomId]}`)
|
||||
} else {
|
||||
|
|
|
@ -207,3 +207,9 @@ const joinButton = document.getElementById("join-btn")
|
|||
joinButton.addEventListener('click', event => {
|
||||
handleJoinSession()
|
||||
})
|
||||
|
||||
// WARNING: COMPLETELY HACKISH SOLUTION --> MUST INTRODUCE SOME SORT OF DELAY!
|
||||
setTimeout(function() {
|
||||
joinButton.click()
|
||||
}, 5000);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<button id="join-btn" data-room="<%= @chat_room.id %>">Join Room</button>
|
||||
<div id="join-btn" data-room="<%= @chat_room.id %>"></div>
|
||||
<!-- <div id="join-session" onclick="handleJoinSession()" data-room="<%= @chat_room.id %>"> -->
|
||||
|
||||
<div id="chatroom-hook" data-chatroom-id='<%= @chat_room.id %>'></div>
|
||||
|
|
Loading…
Reference in New Issue