From 25e17b95d52f64108dd5911b20fa750d8ff5919d Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Fri, 27 Jun 2025 07:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(redemptions-table):=20show?= =?UTF-8?q?=20loading=20indicator=20while=20refetching=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the table did not enter the loading state after performing actions such as deleting, enabling, or disabling a redemption code. This caused a brief period where the UI appeared unresponsive while awaiting the backend response. Changes made: • Added `setLoading(true)` at the beginning of `loadRedemptions` to activate the loading spinner whenever data is (re)fetched. • Added an explanatory code comment to clarify the intent. This improves user experience by clearly indicating that the system is processing and prevents confusion during data refresh operations. --- web/src/components/table/RedemptionsTable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/components/table/RedemptionsTable.js b/web/src/components/table/RedemptionsTable.js index f02d6166..8ee06ba9 100644 --- a/web/src/components/table/RedemptionsTable.js +++ b/web/src/components/table/RedemptionsTable.js @@ -300,6 +300,7 @@ const RedemptionsTable = () => { }; const loadRedemptions = async (startIdx, pageSize) => { + setLoading(true); const res = await API.get( `/api/redemption/?p=${startIdx}&page_size=${pageSize}`, );