fix: bug
This commit is contained in:
@@ -68,39 +68,6 @@ export default function GenerationRecordScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
if (loading && generations.length === 0) {
|
||||
return (
|
||||
<SafeAreaView style={styles.container} edges={['top']}>
|
||||
<StatusBar style="light" />
|
||||
<RNStatusBar barStyle="light-content" />
|
||||
<View style={styles.header}>
|
||||
<Pressable style={styles.backButton} onPress={() => router.back()}>
|
||||
<LeftArrowIcon />
|
||||
</Pressable>
|
||||
<Text style={styles.headerTitle}>{t('generationRecord.title')}</Text>
|
||||
<View style={styles.headerSpacer} />
|
||||
</View>
|
||||
<LoadingState testID="loading-state" />
|
||||
</SafeAreaView>
|
||||
)
|
||||
}
|
||||
|
||||
if (error && generations.length === 0) {
|
||||
return (
|
||||
<SafeAreaView style={styles.container} edges={['top']}>
|
||||
<StatusBar style="light" />
|
||||
<RNStatusBar barStyle="light-content" />
|
||||
<View style={styles.header}>
|
||||
<Pressable style={styles.backButton} onPress={() => router.back()}>
|
||||
<LeftArrowIcon />
|
||||
</Pressable>
|
||||
<Text style={styles.headerTitle}>{t('generationRecord.title')}</Text>
|
||||
<View style={styles.headerSpacer} />
|
||||
</View>
|
||||
<ErrorState testID="error-state" message={error.message} onRetry={handleRefresh} />
|
||||
</SafeAreaView>
|
||||
)
|
||||
}
|
||||
|
||||
const renderItem = ({ item }: { item: TemplateGeneration }) => (
|
||||
<View style={styles.itemContainer}>
|
||||
@@ -155,6 +122,41 @@ export default function GenerationRecordScreen() {
|
||||
</View>
|
||||
)
|
||||
|
||||
if (loading && generations.length === 0) {
|
||||
return (
|
||||
<SafeAreaView style={styles.container} edges={['top']}>
|
||||
<StatusBar style="light" />
|
||||
<RNStatusBar barStyle="light-content" />
|
||||
<View style={styles.header}>
|
||||
<Pressable style={styles.backButton} onPress={() => router.back()}>
|
||||
<LeftArrowIcon />
|
||||
</Pressable>
|
||||
<Text style={styles.headerTitle}>{t('generationRecord.title')}</Text>
|
||||
<View style={styles.headerSpacer} />
|
||||
</View>
|
||||
<LoadingState testID="loading-state" />
|
||||
</SafeAreaView>
|
||||
)
|
||||
}
|
||||
|
||||
if (error && generations.length === 0) {
|
||||
return (
|
||||
<SafeAreaView style={styles.container} edges={['top']}>
|
||||
<StatusBar style="light" />
|
||||
<RNStatusBar barStyle="light-content" />
|
||||
<View style={styles.header}>
|
||||
<Pressable style={styles.backButton} onPress={() => router.back()}>
|
||||
<LeftArrowIcon />
|
||||
</Pressable>
|
||||
<Text style={styles.headerTitle}>{t('generationRecord.title')}</Text>
|
||||
<View style={styles.headerSpacer} />
|
||||
</View>
|
||||
<ErrorState testID="error-state" message={error.message} onRetry={handleRefresh} />
|
||||
</SafeAreaView>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.container} edges={['top']}>
|
||||
<StatusBar style="light" />
|
||||
|
||||
Reference in New Issue
Block a user