Skip to content

Commit a2a131c

Browse files
fix(reset-data): remove reset all data button from settings modal along with logic (#499)
1 parent d8b3a9a commit a2a131c

File tree

1 file changed

+0
-70
lines changed
  • apps/sim/app/w/components/sidebar/components/settings-modal/components/general

1 file changed

+0
-70
lines changed

apps/sim/app/w/components/sidebar/components/settings-modal/components/general/general.tsx

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
import { useEffect, useState } from 'react'
22
import { AlertTriangle, Info } from 'lucide-react'
3-
import { useRouter } from 'next/navigation'
43
import { Alert, AlertDescription } from '@/components/ui/alert'
5-
import {
6-
AlertDialog,
7-
AlertDialogAction,
8-
AlertDialogCancel,
9-
AlertDialogContent,
10-
AlertDialogDescription,
11-
AlertDialogFooter,
12-
AlertDialogHeader,
13-
AlertDialogTitle,
14-
AlertDialogTrigger,
15-
} from '@/components/ui/alert-dialog'
164
import { Button } from '@/components/ui/button'
175
import { Label } from '@/components/ui/label'
186
import {
@@ -25,18 +13,15 @@ import {
2513
import { Skeleton } from '@/components/ui/skeleton'
2614
import { Switch } from '@/components/ui/switch'
2715
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
28-
import { resetAllStores } from '@/stores'
2916
import { useGeneralStore } from '@/stores/settings/general/store'
3017

3118
const TOOLTIPS = {
3219
debugMode: 'Enable visual debugging information during execution.',
3320
autoConnect: 'Automatically connect nodes.',
3421
autoFillEnvVars: 'Automatically fill API keys.',
35-
resetData: 'Permanently delete all workflows, settings, and stored data.',
3622
}
3723

3824
export function General() {
39-
const router = useRouter()
4025
const [retryCount, setRetryCount] = useState(0)
4126

4227
const isLoading = useGeneralStore((state) => state.isLoading)
@@ -81,11 +66,6 @@ export function General() {
8166
}
8267
}
8368

84-
const handleResetData = () => {
85-
resetAllStores()
86-
router.push('/w/1') // Redirect to home page after reset
87-
}
88-
8969
const handleRetry = () => {
9070
setRetryCount((prev) => prev + 1)
9171
}
@@ -224,56 +204,6 @@ export function General() {
224204
)}
225205
</div>
226206
</div>
227-
228-
{/* Danger Zone Section */}
229-
<div>
230-
<div className='flex items-center justify-between py-1'>
231-
<div className='flex items-center gap-2'>
232-
<Label className='font-medium'>Reset all data</Label>
233-
<Tooltip>
234-
<TooltipTrigger asChild>
235-
<Button
236-
variant='ghost'
237-
size='sm'
238-
className='h-7 p-1 text-gray-500'
239-
aria-label='Learn more about resetting all data'
240-
disabled={isLoading}
241-
>
242-
<Info className='h-5 w-5' />
243-
</Button>
244-
</TooltipTrigger>
245-
<TooltipContent side='top' className='max-w-[300px] p-3'>
246-
<p className='text-sm'>{TOOLTIPS.resetData}</p>
247-
</TooltipContent>
248-
</Tooltip>
249-
</div>
250-
<AlertDialog>
251-
<AlertDialogTrigger asChild>
252-
<Button variant='destructive' size='sm' disabled={isLoading}>
253-
Reset Data
254-
</Button>
255-
</AlertDialogTrigger>
256-
<AlertDialogContent>
257-
<AlertDialogHeader>
258-
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
259-
<AlertDialogDescription>
260-
This action cannot be undone. This will permanently delete all your workflows,
261-
settings, and stored data.
262-
</AlertDialogDescription>
263-
</AlertDialogHeader>
264-
<AlertDialogFooter>
265-
<AlertDialogCancel>Cancel</AlertDialogCancel>
266-
<AlertDialogAction
267-
onClick={handleResetData}
268-
className='bg-destructive text-destructive-foreground hover:bg-destructive/90'
269-
>
270-
Reset Data
271-
</AlertDialogAction>
272-
</AlertDialogFooter>
273-
</AlertDialogContent>
274-
</AlertDialog>
275-
</div>
276-
</div>
277207
</div>
278208
)
279209
}

0 commit comments

Comments
 (0)