Add null checks to toggle button initialization to prevent errors

This commit is contained in:
Damian-I
2025-03-09 00:19:56 +00:00
parent 2c359fc46f
commit 538bfd2b68

View File

@@ -6406,15 +6406,21 @@
function initializeToggleButtons() {
// Set up notes toggle button
const notesToggle = document.getElementById('notes-toggle');
notesToggle.addEventListener('click', toggleNotesPanel);
if (notesToggle) {
notesToggle.addEventListener('click', toggleNotesPanel);
}
// Set up bluetooth toggle button
const bluetoothToggle = document.getElementById('bluetooth-toggle');
bluetoothToggle.addEventListener('click', toggleBluetoothPanel);
if (bluetoothToggle) {
bluetoothToggle.addEventListener('click', toggleBluetoothPanel);
}
// Set up biometrics toggle button
const biometricsToggle = document.getElementById('biometrics-toggle');
biometricsToggle.addEventListener('click', toggleBiometricsPanel);
if (biometricsToggle) {
biometricsToggle.addEventListener('click', toggleBiometricsPanel);
}
}
// Call the initialization function when the game starts