function create_new_room(e){
    const socket = io()
    socket.emit("create_new_session", function(feedback){
        if(feedback.success){
            // Delete the create button so no new rooms can be created
            const create_button = document.getElementById('create_new_session_btn')
            create_button.parentNode.removeChild(create_button)
            create_button.removeEventListener("click", create_new_room)

            // Update the room info wrapper
            created_room_code = feedback.room_code
            update_room_info_wrapper(feedback.room_code)
        }
        else{
            alert("Error while generating your room! Please try again later, thanks.")
        }
    })
}
// On button click, create new room if one not already created
On button click, create new room if one not already created
On button click create new room if one not already created
function create_new_room(e){
    const socket = io()
    socket.emit("create_new_session", function(feedback){
        if(feedback.success){
            const create_button = document.getElementById('create_new_session_btn')
            create_button.parentNode.removeChild(create_button)
            create_button.removeEventListener("click", create_new_room)
            created_room_code = feedback.room_code
            update_room_info_wrapper(feedback.room_code)
        }
        else{
            alert("Error while generating your room! Please try again later, thanks.")
        }
    })
}
function create_new_room ( e ) { const socket = io ( ) socket . emit ( "create_new_session" , function ( feedback ) { if ( feedback . success ) { const create_button = document . getElementById ( 'create_new_session_btn' ) create_button . parentNode . removeChild ( create_button ) create_button . removeEventListener ( "click" , create_new_room ) created_room_code = feedback . room_code update_room_info_wrapper ( feedback . room_code ) } else { alert ( "Error while generating your room! Please try again later, thanks." ) } } ) }
On button click, create new room if one not already created
On button click create new room if one not already created
// Delete the create button so no new rooms can be created // Update the room info wrapper