ui: state provider: try to find string encoded values in dictionary

My browser here is pretty fixated on the history, and due to some
unknown reason I got a history fragment string like:
`#v1:=0:=18:=4:::::::` so the "hashes" got into strings, and I was
not able to move them back.

Adding a match here to always try reverse-mapping the hash to the
original input helps to fix that here.

We'd only run into issues if we'd use a integer-string as id, but we
really don't (IIRC not even allowed in extjs) so this is safe to do.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-05-17 18:21:50 +02:00
parent 2f6cf848b6
commit d6b661874c

View File

@ -124,15 +124,14 @@ Ext.define('PVE.StateProvider', {
if (value) {
if (value[0] === '=') {
value = decodeURIComponent(value.slice(1));
} else {
}
for (const [key, hash] of Object.entries(me.compDict)) {
if (value === hash) {
if (String(value) === String(hash)) {
value = key;
break;
}
}
}
}
state[rec[0]] = value;
});