feat: 统一文件名大小写,优化代码可读性;注释掉调试信息以减少控制台输出

This commit is contained in:
康猛 2026-01-14 14:41:49 +08:00
parent 56653da1dd
commit a5b825e761
8 changed files with 45 additions and 32 deletions

32
.vscode/settings.json vendored
View File

@ -1,16 +1,16 @@
{ // {
"editor.codeActionsOnSave": { // "editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit", // "source.fixAll.eslint": "explicit",
"source.organizeImports": "never" // "source.organizeImports": "never"
}, // },
"editor.formatOnSave": true, // "editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint", // "editor.defaultFormatter": "dbaeumer.vscode-eslint",
"eslint.useFlatConfig": true, // "eslint.useFlatConfig": true,
"eslint.format.enable": true, // "eslint.format.enable": true,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], // "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.workingDirectories": [ // "eslint.workingDirectories": [
{ // {
"mode": "auto" // "mode": "auto"
} // }
] // ]
} // }

View File

@ -1,4 +1,3 @@
import * as Sentry from '@sentry/react-native'
import { type Directory, Paths } from 'expo-file-system' import { type Directory, Paths } from 'expo-file-system'
import * as FileSystem from 'expo-file-system/legacy' import * as FileSystem from 'expo-file-system/legacy'
import * as ImagePicker from 'expo-image-picker' import * as ImagePicker from 'expo-image-picker'
@ -243,8 +242,20 @@ export default observer(function TabTwoScreen() {
<Button <Button
title="Try!" title="Try!"
onPress={() => { onPress={() => {
Sentry.captureMessage('Test from Android Build') // Sentry.captureMessage('Test from Android Build')
// throw new Error('Test Sentry Integration') throw new Error('Test Sentry Integration')
// Sentry.captureException('useUpdateCheckerError11', {
// level: 'error',
// tags: {
// useUpdateChecker: 'checkForUpdateAsync_failed',
// component: 'useUpdateChecker',
// },
// contexts: {
// update: {
// __DEV__: __DEV__,
// },
// },
// })
}} }}
/> />
@ -379,7 +390,7 @@ export default observer(function TabTwoScreen() {
// Array(5) // Array(5)
// .fill('https://cdn.roasmax.cn/material/8836b879f2d44af48eef8da82d13a755.mp4') // .fill('https://cdn.roasmax.cn/material/8836b879f2d44af48eef8da82d13a755.mp4')
contents.map((item, index) => { contents.map((item, index) => {
console.log('item-----------', item) // console.log('item-----------', item)
const url = buildCdnUrl(item) const url = buildCdnUrl(item)
if (!url) return null if (!url) return null
const Width = 100 const Width = 100

View File

@ -83,7 +83,9 @@ const Index = observer(function Index() {
return { return {
id: template.id, id: template.id,
type: isVideo ? 'video' : 'image', type: isVideo ? 'video' : 'image',
url: isVideo ? (template.previewUrl ?? '') : template.coverImageUrl || template.previewUrl || '', url: isVideo
? (template?.webpPreviewUrl ?? template?.previewUrl)
: template.coverImageUrl || template.previewUrl || '',
poster: isVideo ? template.coverImageUrl : undefined, poster: isVideo ? template.coverImageUrl : undefined,
likeCount: template.likeCount || 0, likeCount: template.likeCount || 0,
price: template.price || 0, price: template.price || 0,

View File

@ -197,7 +197,6 @@ const Sync = observer(() => {
templateId: '', templateId: '',
asset: result, asset: result,
price: -1, price: -1,
// ...(typeof asset === 'object' ? asset : {}),
} }
setSelectedItem(newItem) setSelectedItem(newItem)
@ -470,6 +469,8 @@ const UpdateNameModal = ({ initialName, onNameChange, onConfirm, onCancel }: any
const SyncProgressToast = observer(() => { const SyncProgressToast = observer(() => {
const { transferProgress } = bleStore.state const { transferProgress } = bleStore.state
const progressHint =
Number(transferProgress) <= 0 ? `正在同步文件` : `正在同步文件,进度 ${transferProgress.toFixed(2)}%`
return ( return (
<Block <Block
className="flex w-full flex-row items-center justify-center border-[3px] border-white bg-black" className="flex w-full flex-row items-center justify-center border-[3px] border-white bg-black"
@ -477,7 +478,7 @@ const SyncProgressToast = observer(() => {
> >
<SpinningLoader /> <SpinningLoader />
<Block style={{ marginLeft: 8 }}> <Block style={{ marginLeft: 8 }}>
<Text className="font-[bla]ck text-[14px] text-white">{`正在同步文件,进度 ${transferProgress.toFixed(2)}%`}</Text> <Text className="font-[bla]ck text-[14px] text-white">{progressHint}</Text>
</Block> </Block>
</Block> </Block>
) )
@ -858,7 +859,7 @@ const HeaderBanner = observer(({ connectedDevice, onPick }: { connectedDevice: a
if (isAuthenticated) { if (isAuthenticated) {
signOut().then(() => { signOut().then(() => {
Toast.show({ title: '已登出' }) Toast.show({ title: '已登出' })
router.replace('/') // router.replace('/')
}) })
} }
} }

View File

@ -15,7 +15,7 @@ import { bleManager } from '@/ble/managers/bleManager'
import { HotUpdate } from '@/components/hot-update' import { HotUpdate } from '@/components/hot-update'
import { useColorScheme } from '@/hooks/use-color-scheme' import { useColorScheme } from '@/hooks/use-color-scheme'
import { setupGlobalFetchLogger } from '@/lib/fetch-logger' import { setupGlobalFetchLogger } from '@/lib/fetch-logger'
import { useUserSession } from '@/stores/UserStore' import { useUserSession } from '@/stores/userStore'
const isProd = process.env.EXPO_PUBLIC_ENV !== 'development' const isProd = process.env.EXPO_PUBLIC_ENV !== 'development'
@ -23,7 +23,6 @@ Sentry.init({
dsn: 'https://ef710a118839b1e86e38a3833a9a3c6c@o4507705403965440.ingest.us.sentry.io/4510576286302208', dsn: 'https://ef710a118839b1e86e38a3833a9a3c6c@o4507705403965440.ingest.us.sentry.io/4510576286302208',
sendDefaultPii: true, sendDefaultPii: true,
enableLogs: true, enableLogs: true,
// enabled: !__DEV__,
enabled: isProd, enabled: isProd,
}) })
@ -91,7 +90,7 @@ function RootLayout() {
<Stack> <Stack>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} /> <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="auth" options={{ headerShown: false }} /> <Stack.Screen name="auth" options={{ headerShown: false }} />
<Stack.Screen name="forgot-password" options={{ headerShown: false }} /> <Stack.Screen name="forgotPassword" options={{ headerShown: false }} />
<Stack.Screen name="pointList" options={{ headerShown: false }} /> <Stack.Screen name="pointList" options={{ headerShown: false }} />
</Stack> </Stack>
</Providers> </Providers>

View File

@ -48,7 +48,7 @@ class UserBalanceStore {
return this.loadingPromise return this.loadingPromise
} }
console.log('执行余额加载') // console.log('执行余额加载')
this.lastLoadTime = now this.lastLoadTime = now
this.loadingPromise = this.performLoad() this.loadingPromise = this.performLoad()

View File

@ -82,7 +82,7 @@ class UserStore {
await authSignOut() await authSignOut()
this.reset() this.reset()
// 登出时重置余额store // 登出时重置余额store
const { userBalanceStore } = await import('./UserBalanceStore') const { userBalanceStore } = await import('./userBalanceStore')
userBalanceStore.reset() userBalanceStore.reset()
} catch (error) { } catch (error) {
this.setError(error instanceof Error ? error.message : '登出失败') this.setError(error instanceof Error ? error.message : '登出失败')

View File

@ -1,3 +1,3 @@
export { bleStore } from './BleStore' export { bleStore } from './bleStore'
export { userBalanceStore } from './UserBalanceStore' export { userBalanceStore } from './userBalanceStore'
export { userStore } from './UserStore' export { userStore } from './userStore'