refactor(ResourceStatsPage, TrafficDashboard): update button click handlers to use arrow functions for consistency and improve error handling by retaining previous data on fetch failure
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m11s

This commit is contained in:
2026-02-23 01:52:48 +07:00
parent a14f10d048
commit 0b5ec5bd85
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -157,7 +157,7 @@ export default function ResourceStatsPage() {
} catch (e) {
if (e?.name === 'CanceledError' || e?.name === 'AbortError' || e?.code === 'ERR_CANCELED') return;
setError(e?.response?.data?.message || e?.message || 'Не удалось загрузить статистику');
setRouters([]);
// Не очищаем список — пользователь видит старые данные и сообщение об ошибке
} finally {
setLoading(false);
}
@@ -180,7 +180,7 @@ export default function ResourceStatsPage() {
<button
type="button"
className="btn btn-outline-primary"
onClick={fetchStats}
onClick={() => fetchStats()}
disabled={loading}
>
<IconRefresh size={18} className={loading ? 'spin' : ''} />
+1 -1
View File
@@ -274,7 +274,7 @@ export default function TrafficDashboard() {
<button
type="button"
className="btn btn-outline-primary"
onClick={fetchStats}
onClick={() => fetchStats()}
disabled={loading}
>
<IconRefresh className={loading ? 'spin me-2' : 'me-2'} size={18} />