forked from snxraven/LinkUp-P2P-Chat
Fixed removing rooms
This commit is contained in:
parent
72bf632cd4
commit
840b6e2069
8
app.js
8
app.js
@ -278,14 +278,15 @@ function leaveRoom() {
|
||||
if (roomItem) {
|
||||
roomItem.remove();
|
||||
}
|
||||
|
||||
config.rooms = config.rooms.filter(e => e !== currentRoom.topic);
|
||||
writeConfigToFile("./config.json");
|
||||
|
||||
currentRoom.destroy();
|
||||
currentRoom = null;
|
||||
}
|
||||
document.querySelector('#chat').classList.add('hidden');
|
||||
document.querySelector('#setup').classList.remove('hidden');
|
||||
|
||||
config.rooms = config.rooms.filter(e => e !== currentRoom.topic);
|
||||
writeConfigToFile("./config.json");
|
||||
}
|
||||
|
||||
function sendMessage(e) {
|
||||
@ -438,7 +439,6 @@ function toggleSetupView() {
|
||||
}
|
||||
|
||||
function writeConfigToFile(filePath) {
|
||||
console.debug(config)
|
||||
fs.writeFile(filePath, JSON.stringify(config), (err) => {
|
||||
if (err) return console.error(err);
|
||||
console.log("File has been created");
|
||||
|
Loading…
Reference in New Issue
Block a user