diff options
author | silverwind <me@silverwind.io> | 2024-03-25 19:37:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-25 18:37:55 +0000 |
commit | 8fe26fb314f1710139728d9118b455fc6a16cce2 (patch) | |
tree | c6c101f83b74144af61a29b649d63fa7f74b788c /web_src/js/features/admin/common.js | |
parent | f73d891fc4979cbd704d145f7e892f73d0eb5e39 (diff) | |
download | gitea-8fe26fb314f1710139728d9118b455fc6a16cce2.tar.gz gitea-8fe26fb314f1710139728d9118b455fc6a16cce2.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.
Diffstat (limited to 'web_src/js/features/admin/common.js')
-rw-r--r-- | web_src/js/features/admin/common.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/web_src/js/features/admin/common.js b/web_src/js/features/admin/common.js index 3c485d67a6..4e64bff330 100644 --- a/web_src/js/features/admin/common.js +++ b/web_src/js/features/admin/common.js @@ -6,9 +6,7 @@ import {POST} from '../../modules/fetch.js'; const {appSubUrl} = window.config; export function initAdminCommon() { - if ($('.page-content.admin').length === 0) { - return; - } + if (!$('.page-content.admin').length) return; // check whether appUrl(ROOT_URL) is correct, if not, show an error message checkAppUrl(); |