Remove duplicate export and delete account functionality from settings index#59
Remove duplicate export and delete account functionality from settings index#59fortune710 merged 3 commits intofortune710:devfrom
Conversation
…s from SettingsScreen, simplifying the component structure and reducing complexity.
|
|
|
@MaestroDev19 is attempting to deploy a commit to the fortune710's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. WalkthroughThis change removes the Export Data and Delete Account flows from the Settings screen: their UI entries, handlers, state variables, and related imports. Remaining settings items (Profile, Notifications, Privacy, About, Sign Out) are unchanged. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
frontend/app/settings/index.tsx (2)
77-79: Remove the no-oponUpdatehandler.Registering an empty
onUpdatefires the callback on every pan-move event with no effect. If visual feedback isn't planned, drop the call entirely to avoid the unnecessary JS-thread invocations.♻️ Proposed refactor
const swipeDownGesture = Gesture.Pan() .runOnJS(true) .onStart((event) => { startY.current = event.absoluteY; }) - .onUpdate((event) => { - // Optional: Add visual feedback logic here if needed - }) .onEnd((event) => { if (startY.current < SWIPE_THRESHOLD && event.translationY > 100 && event.velocityY > 500) { router.back(); } });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/app/settings/index.tsx` around lines 77 - 79, Remove the no-op .onUpdate((event) => { /* Optional: Add visual feedback logic here if needed */ }) call so the handler chain no longer registers an empty callback that fires on every pan-move; locate the chain where .onUpdate is attached (the .onUpdate((event) => { ... }) invocation) and simply delete that method call (or replace it with a real visual-feedback implementation if you intend to handle updates).
67-68: PreferuseWindowDimensions()overDimensions.get('window')inside the component body.
Dimensions.get('window')is a one-shot read; it won't trigger a re-render on orientation/window-size change, soSWIPE_THRESHOLDcan be stale until the next unrelated render. The idiomatic React Native approach is theuseWindowDimensionshook, which keeps the value reactive.♻️ Proposed refactor
-import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Image, Alert, Dimensions } from 'react-native'; +import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Image, Alert, useWindowDimensions } from 'react-native';export default function SettingsScreen() { const { profile } = useAuthContext(); - const { height: screenHeight } = Dimensions.get('window'); + const { height: screenHeight } = useWindowDimensions(); const SWIPE_THRESHOLD = screenHeight * 0.15;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/app/settings/index.tsx` around lines 67 - 68, Replace the one-time Dimensions.get('window') call with the reactive useWindowDimensions hook: import useWindowDimensions from 'react-native' and inside the component call const { height: screenHeight } = useWindowDimensions(); then compute SWIPE_THRESHOLD = screenHeight * 0.15 so SWIPE_THRESHOLD updates on orientation/size changes; update any references to the old Dimensions.get('window') usage and remove that import if now unused.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@frontend/app/settings/index.tsx`:
- Around line 77-79: Remove the no-op .onUpdate((event) => { /* Optional: Add
visual feedback logic here if needed */ }) call so the handler chain no longer
registers an empty callback that fires on every pan-move; locate the chain where
.onUpdate is attached (the .onUpdate((event) => { ... }) invocation) and simply
delete that method call (or replace it with a real visual-feedback
implementation if you intend to handle updates).
- Around line 67-68: Replace the one-time Dimensions.get('window') call with the
reactive useWindowDimensions hook: import useWindowDimensions from
'react-native' and inside the component call const { height: screenHeight } =
useWindowDimensions(); then compute SWIPE_THRESHOLD = screenHeight * 0.15 so
SWIPE_THRESHOLD updates on orientation/size changes; update any references to
the old Dimensions.get('window') usage and remove that import if now unused.
Summary
Removed duplicate export data and delete account functionality from
app/settings/index.tsx, keeping these features only inapp/settings/privacy.tsxwhere they belong.Changes
handleExportData,performExport, andhandleDeleteAccountfunctions from settings indexFileSystem,Sharing,logger,BACKEND_URL,DownloadIcon,Trash2,ActivityIndicatorisDeletingandisExportingsessionfrom auth context destructuringResult
Summary by CodeRabbit