forked from snxraven/LinkUp-P2P-Chat
test
This commit is contained in:
parent
8c0f7ebd0f
commit
a1b11f7ae6
14
app.js
14
app.js
@ -63,6 +63,8 @@ function updatePeerCount() {
|
||||
|
||||
async function processGuild(guildTopic) {
|
||||
// Simulate fetching guild data for the given topic
|
||||
console.log('Processing guild for topic:', guildTopic); // Debugging log
|
||||
|
||||
const guildData = {
|
||||
guildTopic,
|
||||
guildAlias: "Sample Guild",
|
||||
@ -207,6 +209,7 @@ function setupEventListeners() {
|
||||
const attachFileButton = document.getElementById('attach-file');
|
||||
const fileInput = document.getElementById('file-input');
|
||||
const talkButton = document.getElementById('talk-btn');
|
||||
const joinGuildBtn = document.getElementById('join-guild');
|
||||
|
||||
if (registerForm) {
|
||||
registerForm.addEventListener('submit', registerUser);
|
||||
@ -246,6 +249,17 @@ function setupEventListeners() {
|
||||
if (talkButton) {
|
||||
setupTalkButton();
|
||||
}
|
||||
if (joinGuildBtn) {
|
||||
joinGuildBtn.addEventListener('click', async (event) => {
|
||||
const guildTopic = document.getElementById('join-guild-topic').value.trim();
|
||||
if (guildTopic) {
|
||||
console.log('Join Guild button clicked with topic:', guildTopic); // Debugging log
|
||||
await processGuild(guildTopic);
|
||||
} else {
|
||||
console.error('Guild topic is empty');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Add event listeners only for room items
|
||||
document.querySelectorAll('.room-item').forEach(item => {
|
||||
|
Loading…
Reference in New Issue
Block a user