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
27 changed files with 174 additions and 240 deletions

View File

@@ -30,11 +30,9 @@
// This file is the JavaScript implementation of base/utils/fs.cpp
if (window.qBittorrent === undefined)
window.qBittorrent = {};
window.qBittorrent.Filesystem = (function() {
const exports = function() {
window.qBittorrent ??= {};
window.qBittorrent.Filesystem ??= (() => {
const exports = () => {
return {
PathSeparator: PathSeparator,
fileExtension: fileExtension,
@@ -71,5 +69,4 @@ window.qBittorrent.Filesystem = (function() {
return exports();
})();
Object.freeze(window.qBittorrent.Filesystem);