fix: bug
This commit is contained in:
@@ -7,7 +7,6 @@ import {
|
||||
Dimensions,
|
||||
Pressable,
|
||||
StatusBar as RNStatusBar,
|
||||
RefreshControl,
|
||||
} from 'react-native'
|
||||
import { StatusBar } from 'expo-status-bar'
|
||||
import { SafeAreaView } from 'react-native-safe-area-context'
|
||||
@@ -38,7 +37,6 @@ export default function My() {
|
||||
const { t, i18n } = useTranslation()
|
||||
const [editDrawerVisible, setEditDrawerVisible] = useState(false)
|
||||
const [profileName, setProfileName] = useState('乔乔乔乔')
|
||||
const [refreshing, setRefreshing] = useState(false)
|
||||
|
||||
// 使用 useTemplateGenerations hook 获取用户作品列表
|
||||
const {
|
||||
@@ -54,13 +52,6 @@ export default function My() {
|
||||
loadGenerations({ page: 1, limit: 50 })
|
||||
}, [])
|
||||
|
||||
// 处理下拉刷新
|
||||
const handleRefresh = useCallback(async () => {
|
||||
setRefreshing(true)
|
||||
await refetch({ page: 1, limit: 50 })
|
||||
setRefreshing(false)
|
||||
}, [refetch])
|
||||
|
||||
// 处理设置菜单选择
|
||||
const handleSettingsSelect = async (value: string) => {
|
||||
if (value === 'changePassword') {
|
||||
@@ -179,21 +170,13 @@ export default function My() {
|
||||
</View>
|
||||
|
||||
{/* 作品九宫格 */}
|
||||
{loading && !refreshing ? (
|
||||
{loading ? (
|
||||
<MySkeleton />
|
||||
) : (
|
||||
<ScrollView
|
||||
style={styles.scrollView}
|
||||
contentContainerStyle={styles.scrollContent}
|
||||
showsVerticalScrollIndicator={false}
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
refreshing={refreshing}
|
||||
onRefresh={handleRefresh}
|
||||
tintColor="#FFFFFF"
|
||||
colors={['#FFFFFF']}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<View style={styles.galleryGrid}>
|
||||
{generations.map((item, index) => (
|
||||
|
||||
Reference in New Issue
Block a user