fix(history,workout-builder): memoize async load functions with useCallback

This commit is contained in:
2026-08-12 12:59:27 +02:00
parent 2bb4225260
commit 2096489fd1
2 changed files with 6 additions and 6 deletions
@@ -27,15 +27,15 @@ export function HistoryScreen() {
const [sessions, setSessions] = useState<SessionRow[]>([]);
const [refreshing, setRefreshing] = useState(false);
const loadSessions = async () => {
const loadSessions = useCallback(async () => {
const data = await getAllSessions();
setSessions(data as SessionRow[]);
};
}, []);
useFocusEffect(
useCallback(() => {
loadSessions();
}, [])
}, [loadSessions])
);
const onRefresh = async () => {