From 06f7ce3def89118a6d9f4913a3402cceed808536 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 5 May 2024 23:54:36 +0200 Subject: [PATCH] use setItem to cause rerenders on point --- src/frontend/src/pages/Index/Scan.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/Index/Scan.tsx b/src/frontend/src/pages/Index/Scan.tsx index cb3e9bfb7b..3f36aad504 100644 --- a/src/frontend/src/pages/Index/Scan.tsx +++ b/src/frontend/src/pages/Index/Scan.tsx @@ -169,15 +169,17 @@ export default function Scan() { .get(url) .then((response) => { item.instance = response.data; + const list_idx = history.findIndex((i) => i.id === id); + historyHandlers.setItem(list_idx, item); }) .catch((err) => { console.error('error while fetching instance data at', url); console.info(err); }); } + } else { + historyHandlers.setState(history); } - - historyHandlers.setState(history); }) .catch((err) => { // 400 and no plugin means no match