Working on Config system (Saving & Loading user data) #3

Merged
snxraven merged 16 commits from MiTask/LinkUp-P2P-Chat:main into main 2024-06-09 03:11:48 -04:00
Showing only changes of commit a3fbe7434a - Show all commits

13
app.js
View File

@ -95,13 +95,16 @@ async function initialize() {
});
}
readConfigFromFile();
config.rooms.forEach(room => {
addRoomToList(room);
});
const configExists = fs.existsSync("./config.json");
if (configExists) {
readConfigFromFile();
config.rooms.forEach(room => {
addRoomToList(room);
});
}
const registerDiv = document.querySelector('#register');
if (registerDiv && config.userName !== '') {
if (registerDiv && !configExists) {
registerDiv.classList.remove('hidden');
}