]> git.proxmox.com Git - pve-manager.git/commit - www/manager6/Utils.js
fix #4370: ui: fix regression of preselecting tree element on login
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 28 Nov 2022 12:34:00 +0000 (13:34 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 28 Nov 2022 16:59:30 +0000 (17:59 +0100)
commitad02432922e5290f1d250a19a2509c5713262e01
treef91f5d5d8438f8d63be1c7d9ffc7e153ecc1437b
parentd1bb39d448d1bb2e07aa483044c6f2f504f9ff11
fix #4370: ui: fix regression of preselecting tree element on login

We want to select a tree element based on the fragment in the url after
a login. For which we must wait for the tree (ResourceStore) to load.

Since we recently introduced the loading of '/cluster/options' to
load the overrides of tags, etc. we fire a 'load' event with the
intention of triggering a rerender of the tree (to include the new
colors). If that triggers before the ResourceStore is loaded,
we try to set the element once (which fails) and nothing is selected.

To fix this, we only trigger it if it was already loaded and is not
currently loading. Otherwise it will be either redrawn after the ongoing
load, or by the first load.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Utils.js