revert test
This commit is contained in:
snxraven 2024-06-22 21:19:28 +00:00
parent 8c0f7ebd0f
commit de9e01e932
2 changed files with 9 additions and 23 deletions

26
app.js
View File

@ -61,30 +61,18 @@ function updatePeerCount() {
} }
} }
async function processGuild(guildTopic) { async function processGuild(guildData) {
// Simulate fetching guild data for the given topic const parsedData = JSON.parse(guildData);
const guildData = { config.guilds[parsedData.guildTopic] = {
guildTopic, alias: parsedData.guildAlias,
guildAlias: "Sample Guild", rooms: parsedData.rooms,
rooms: [ owner: parsedData.owner
{ topic: "room1", alias: "Room 1" },
{ topic: "room2", alias: "Room 2" }
],
owner: config.userName
};
config.guilds[guildData.guildTopic] = {
alias: guildData.guildAlias,
rooms: guildData.rooms,
owner: guildData.owner
}; };
writeConfigToFile("./config.json"); writeConfigToFile("./config.json");
renderGuildList(); renderGuildList();
await joinGuild(guildData.guildTopic); await joinGuild(parsedData.guildTopic);
} }
export { processGuild };
async function joinGuild(guildTopic) { async function joinGuild(guildTopic) {
const guild = config.guilds[guildTopic]; const guild = config.guilds[guildTopic];
if (guild) { if (guild) {

View File

@ -103,9 +103,7 @@
</div> </div>
</div> </div>
<script type="module"> <script>
import { processGuild } from './app.js';
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const messageInput = document.getElementById('message'); const messageInput = document.getElementById('message');
const copyTopicLink = document.getElementById('copy-topic-link'); const copyTopicLink = document.getElementById('copy-topic-link');
@ -256,4 +254,4 @@
} }
</script> </script>
</body> </body>
</html> </html>