From d6b661874caaee6579a8540f9680007d086eb84e Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 17 May 2021 18:21:50 +0200 Subject: [PATCH] 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 --- www/manager6/StateProvider.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/www/manager6/StateProvider.js b/www/manager6/StateProvider.js index cba3884e..4517c15a 100644 --- a/www/manager6/StateProvider.js +++ b/www/manager6/StateProvider.js @@ -124,12 +124,11 @@ 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) { - value = key; - break; - } + } + for (const [key, hash] of Object.entries(me.compDict)) { + if (String(value) === String(hash)) { + value = key; + break; } } }