WebUI: fix preferences not applied in magnet handler

Thanks for the diagnosis in this [post](https://github.com/qbittorrent/qBittorrent/issues/22495#issue-2958553624).

Closes #21486.
Closes #22495.
PR #22504.
This commit is contained in:
Chocobo1
2025-04-05 13:51:08 +08:00
committed by Vladimir Golovnev (Glassez)
parent d492fcf29a
commit 57d529c17a

View File

@@ -131,7 +131,11 @@ window.qBittorrent.Download ??= (() => {
}
};
$(window).addEventListener("load", () => {
$(window).addEventListener("load", async () => {
// user might load this page directly (via browser magnet handler)
// so wait for crucial initialization to complete
await window.parent.qBittorrent.Client.initializeCaches();
getPreferences();
getCategories();
});