diff --git a/static/js/utils/theme.js b/static/js/utils/theme.js index 5be5c7c..b2cc9d1 100644 --- a/static/js/utils/theme.js +++ b/static/js/utils/theme.js @@ -1,5 +1,6 @@ const Theme = { _current: 'dark', + _toggling: false, init() { this._current = localStorage.getItem('turbosu-theme') || 'dark'; @@ -7,8 +8,11 @@ const Theme = { }, toggle() { + if (this._toggling) return; + this._toggling = true; this._current = this._current === 'dark' ? 'light' : 'dark'; this.apply(); + setTimeout(() => { this._toggling = false; }, 200); }, apply() {