fix: theme toggle double-click bug - remove duplicate listener
This commit is contained in:
+1
-9
@@ -10,15 +10,7 @@
|
||||
PageSettings.init();
|
||||
Router.init();
|
||||
|
||||
document.getElementById('theme-toggle').addEventListener('click', () => {
|
||||
Theme.toggle();
|
||||
});
|
||||
|
||||
const savedTheme = localStorage.getItem('turbosu-theme');
|
||||
if (savedTheme && savedTheme !== Theme.current) {
|
||||
Theme._current = savedTheme;
|
||||
Theme.apply();
|
||||
}
|
||||
document.getElementById('theme-toggle').addEventListener('click', () => Theme.toggle());
|
||||
|
||||
console.log('%cTurboSu %cReady',
|
||||
'color:#667eea;font-size:16px;font-weight:bold;',
|
||||
|
||||
@@ -4,10 +4,6 @@ const Topbar = {
|
||||
init() {
|
||||
this._statusEl = document.getElementById('connection-status');
|
||||
|
||||
document.getElementById('theme-toggle').addEventListener('click', () => {
|
||||
Theme.toggle();
|
||||
});
|
||||
|
||||
WS.on('status', (status) => {
|
||||
this._statusEl.className = `status-indicator ${status}`;
|
||||
this._statusEl.querySelector('.status-text').textContent =
|
||||
|
||||
Reference in New Issue
Block a user