diff options
author | silverwind <me@silverwind.io> | 2024-03-25 19:37:55 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-03-30 07:17:30 +0100 |
commit | c55e30ff13d43fac40cc2064d3e17c035385279c (patch) | |
tree | 7debddd484411c78779a691ca04ee62376633411 /web_src/js/features/user-settings.js | |
parent | Remove fomantic table module (#30047) (diff) | |
download | forgejo-c55e30ff13d43fac40cc2064d3e17c035385279c.tar.xz forgejo-c55e30ff13d43fac40cc2064d3e17c035385279c.zip |
Refactor all `.length === 0` patterns in JS (#30045)
This pattern comes of often during review, so let's fix it once and for
all. Did not test, but changes are trivial enough imho.
(cherry picked from commit 8fe26fb314f1710139728d9118b455fc6a16cce2)
Diffstat (limited to '')
-rw-r--r-- | web_src/js/features/user-settings.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/web_src/js/features/user-settings.js b/web_src/js/features/user-settings.js index 0dd908f34a..2d8c53e457 100644 --- a/web_src/js/features/user-settings.js +++ b/web_src/js/features/user-settings.js @@ -1,7 +1,7 @@ import {hideElem, showElem} from '../utils/dom.js'; export function initUserSettings() { - if (document.querySelectorAll('.user.settings.profile').length === 0) return; + if (!document.querySelectorAll('.user.settings.profile').length) return; const usernameInput = document.getElementById('username'); if (!usernameInput) return; |