From 68a81ddbf375f831c88a7fd96137f876cdb84293 Mon Sep 17 00:00:00 2001 From: Tony AVERTY Date: Wed, 7 Oct 2026 13:48:11 +0200 Subject: [PATCH] =?UTF-8?q?App=20:=20plus=20de=20=C2=AB=20tirer=20pour=20a?= =?UTF-8?q?ctualiser=20=C2=BB=20(accueil,=20statistiques,=20historique)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les données se rechargent à l'ouverture de chaque écran. Co-Authored-By: Claude Opus 5.5 --- pro/app/history.tsx | 6 +++--- pro/app/index.tsx | 16 ++++------------ pro/app/stats.tsx | 15 +++------------ 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/pro/app/history.tsx b/pro/app/history.tsx index 9fa8a54..6faebbb 100644 --- a/pro/app/history.tsx +++ b/pro/app/history.tsx @@ -84,10 +84,10 @@ export default function History() { contentContainerStyle={{ paddingHorizontal: 16, paddingBottom: 32 }} onEndReached={() => cursor && !loading && load(false)} onEndReachedThreshold={0.5} - refreshing={loading && items.length === 0} - onRefresh={() => load(true)} + bounces={false} + overScrollMode="never" ListEmptyComponent={!loading ? Aucune opération sur la période. : null} - ListFooterComponent={loading && items.length > 0 ? : null} + ListFooterComponent={loading ? : null} ItemSeparatorComponent={() => } renderItem={({ item: o }) => { const rejected = o.type === 'REJECTED'; diff --git a/pro/app/index.tsx b/pro/app/index.tsx index 883784f..b3378a7 100644 --- a/pro/app/index.tsx +++ b/pro/app/index.tsx @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react'; -import { Alert, Linking, Pressable, RefreshControl, ScrollView, View } from 'react-native'; +import { Alert, Linking, Pressable, ScrollView, View } from 'react-native'; import { router, useFocusEffect } from 'expo-router'; import { SafeAreaView } from 'react-native-safe-area-context'; import Svg, { Path } from 'react-native-svg'; @@ -58,7 +58,6 @@ function Counter() { const { me, logout } = useSession(); const store = useStore(); const [summary, setSummary] = useState(null); - const [refreshing, setRefreshing] = useState(false); const [tab, setTab] = useState<'scan' | 'config'>('scan'); const load = useCallback(async () => { @@ -81,16 +80,9 @@ function Counter() { { - setRefreshing(true); - await load(); - setRefreshing(false); - }} - /> - } + // Pas de « tirer pour actualiser » : les chiffres se rechargent à chaque retour sur l'écran. + bounces={false} + overScrollMode="never" > diff --git a/pro/app/stats.tsx b/pro/app/stats.tsx index aa44374..5213801 100644 --- a/pro/app/stats.tsx +++ b/pro/app/stats.tsx @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react'; -import { Alert, Pressable, RefreshControl, ScrollView, View } from 'react-native'; +import { Alert, Pressable, ScrollView, View } from 'react-native'; import { useFocusEffect } from 'expo-router'; import { api, ApiError } from '../src/api'; import { describe } from '../src/errors'; @@ -37,7 +37,6 @@ export default function StatsScreen() { const [data, setData] = useState(null); const [error, setError] = useState(null); const [locked, setLocked] = useState(false); - const [refreshing, setRefreshing] = useState(false); const [sending, setSending] = useState(null); const load = useCallback(async (d: number) => { @@ -94,16 +93,8 @@ export default function StatsScreen() { return ( { - setRefreshing(true); - await load(days); - setRefreshing(false); - }} - /> - } + bounces={false} + overScrollMode="never" > {PERIODS.map(([d, label]) => (