mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
perf(app): reduce redundant data fetching
Share bounded database pools across API repositories, consolidate sync and chat queries, and make mobile refreshes cache-aware and foreground-aware. Add focused regression coverage, client freshness documentation, and repository agent role configuration.
This commit is contained in:
1 parent
9957fa43f2
commit
c7ee8a4851
81 files changed
+4456
-1400
No files matched your search
@@ -44,7 +44,7 @@ const AnimatedFlatList = Animated.createAnimatedComponent(FlatList<Question>);
|
||||
export default function PackDetailsScreen() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const router = useRouter();
|
||||
const { packs, fetchPacks } = usePacksStore();
|
||||
const { packs, ensurePacksLoaded } = usePacksStore();
|
||||
const { subscription } = useSubscriptionStore();
|
||||
const { user, partner } = useAuthStore();
|
||||
const [questions, setQuestions] = useState<Question[]>([]);
|
||||
@@ -61,9 +61,7 @@ export default function PackDetailsScreen() {
|
||||
const category = categories.find(c => c.id === pack?.category_id);
|
||||
|
||||
useEffect(() => {
|
||||
if (packs.length === 0) {
|
||||
fetchPacks();
|
||||
}
|
||||
void ensurePacksLoaded();
|
||||
fetchPackDetails();
|
||||
}, [id]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user