mirror of
https://github.com/beatriceo/polyglot.git
synced 2025-10-25 18:52:11 +00:00
added autoclick on join room
This commit is contained in:
@@ -24,19 +24,13 @@ App.cable.subscriptions.create({
|
||||
// console.log(userId)
|
||||
console.log("received broadcast")
|
||||
// console.log(data.body)
|
||||
if (data.head === 302 && data.body["caller"] === userId && data.path ) {
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user