diff --git a/@share/components/ConfirmModal.tsx b/@share/components/ConfirmModal.tsx index 9c04221..b4cf66e 100644 --- a/@share/components/ConfirmModal.tsx +++ b/@share/components/ConfirmModal.tsx @@ -1,5 +1,6 @@ import { Ionicons } from '@expo/vector-icons' import React, { type ReactNode } from 'react' +import { KeyboardAwareScrollView } from 'react-native-keyboard-controller' import Block from './Block' import Text from './Text' @@ -49,50 +50,50 @@ const ConfirmModal: React.FC = ({ } return ( - - - - {badge} - - - {title} - - - - {typeof content === 'string' ? ( - {content} - ) : ( - content - )} - - - - - {cancelText} + + + + + {badge} - - {confirmLoading ? ( - <> - - {confirmText} - + {title} + + + + {typeof content === 'string' ? ( + {content} ) : ( - <> - {confirmText} - {title==='确认支付?' && ( - - )} - + content )} + + + + {cancelText} + + + + {confirmLoading ? ( + <> + + {confirmText} + + ) : ( + <> + {confirmText} + {title === '确认支付?' && } + + )} + + - + ) } diff --git a/app/(tabs)/explore.tsx b/app/(tabs)/explore.tsx index d73aac5..dbf39c3 100644 --- a/app/(tabs)/explore.tsx +++ b/app/(tabs)/explore.tsx @@ -37,7 +37,7 @@ export default observer(function TabTwoScreen() { const isConnected = bleStore.state.isConnected - console.log('isConnected----------', isConnected) + // console.log('isConnected----------', isConnected) const { galleryList: contents } = bleStore diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 37c87bd..c6b099f 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -582,11 +582,6 @@ const GooActions = observer(function GooActions({ gooPoints, on {isDev && isPolling && } )} - {!!isLogin && ( - router.push('/settings')}> - - - )} { // 加载生成记录 useEffect(() => { if (isFocused) { - loadGenerations() + // loadGenerations() } }, [isFocused]) @@ -423,7 +423,7 @@ const Sync = observer(() => { } @@ -499,6 +499,9 @@ const DeviceItem = observer(({ device }: { device: any }) => { const canEdit = !!bindDevice && isConnected + // 绑定过的设备 + const hasBind = !!bleStore.bindDeviceList?.find((d) => d?.id === id) + const { id: userId } = userStore.user || {} const onConnectToggle = async (device: any) => { if (device.connected) { @@ -623,6 +626,16 @@ const DeviceItem = observer(({ device }: { device: any }) => { {isConnected ? '已连接' : '未连接'} + + {hasBind && ( + + + 绑定过 + + + )} @@ -856,13 +869,10 @@ const HeaderBanner = observer(({ connectedDevice, onPick }: { connectedDevice: a const handleLogout = () => { if (isLogin) { - signOut().then(() => { - Toast.show({ title: '已登出' }) - router.replace('/auth') - }) + router.push('/settings') } } - const loginText = isLogin ? '登出' : '登录' + const loginText = isLogin ? '设置' : '登录' return ( diff --git a/hooks/data/use-template-generations.ts b/hooks/data/use-template-generations.ts index 0ae8add..c903647 100644 --- a/hooks/data/use-template-generations.ts +++ b/hooks/data/use-template-generations.ts @@ -1,6 +1,6 @@ import { root } from '@repo/core' import { type ListTemplateGenerationsInput, type TemplateGeneration, TemplateGenerationController } from '@repo/sdk' -import { useCallback, useRef, useState } from 'react' +import { useCallback, useEffect, useRef, useState } from 'react' import { type ApiError } from '@/lib/types' @@ -19,14 +19,13 @@ export const useTemplateGenerations = () => { const load = useCallback(async (params?: ListTemplateGenerationsInput) => { setLoading(true) setError(null) - currentPageRef.current = 1 const templateGeneration = root.get(TemplateGenerationController) const { data, error } = await handleError( async () => await templateGeneration.list({ - page: currentPageRef.current, + page: 1, limit: params?.limit || pageSize, ...params, }), @@ -93,6 +92,10 @@ export const useTemplateGenerations = () => { [load], ) + useEffect(() => { + load() + }, []) + return { data, loading,