WebUI: avoid redundant re-initialization

PR #21012.
This commit is contained in:
Chocobo1 2024-07-12 15:00:36 +08:00 committed by GitHub
parent 9c26e5d4d6
commit 9feefc8144
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 174 additions and 240 deletions

View file

@ -28,11 +28,9 @@
"use strict";
if (window.qBittorrent === undefined)
window.qBittorrent = {};
window.qBittorrent.PropFiles = (function() {
const exports = function() {
window.qBittorrent ??= {};
window.qBittorrent.PropFiles ??= (() => {
const exports = () => {
return {
normalizePriority: normalizePriority,
isDownloadCheckboxExists: isDownloadCheckboxExists,
@ -769,5 +767,4 @@ window.qBittorrent.PropFiles = (function() {
return exports();
})();
Object.freeze(window.qBittorrent.PropFiles);