Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bxdoan committed Jan 14, 2025
1 parent 7d4f9e7 commit a75bc6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
5 changes: 1 addition & 4 deletions web/screens/Settings/Advanced/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,7 @@ const Advanced = () => {
<div className="flex w-full flex-col items-start justify-between gap-4 border-b border-[hsla(var(--app-border))] py-4 first:pt-0 last:border-none sm:flex-row">
<div className="space-y-1">
<div className="flex gap-x-2">
<h6 className="font-semibold capitalize">
Delete All Threads
</h6>
<h6 className="font-semibold capitalize">Delete All Threads</h6>
</div>
<p className="whitespace-pre-wrap font-medium leading-relaxed text-[hsla(var(--text-secondary))]">
Delete all threads and associated chat history.
Expand All @@ -557,7 +555,6 @@ const Advanced = () => {
</Button>
</div>
<ModalDeleteAllThreads />

</div>
</ScrollArea>
)
Expand Down
18 changes: 13 additions & 5 deletions web/screens/Thread/ThreadLeftPanel/ModalDeleteAllThreads/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import { useCallback, memo } from 'react'
import { Modal, ModalClose, Button } from '@janhq/joi'
import { useAtom, useAtomValue } from 'jotai'

Check failure on line 3 in web/screens/Thread/ThreadLeftPanel/ModalDeleteAllThreads/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-ubuntu-pr-target

There should be at least one empty line between import groups

Check failure on line 3 in web/screens/Thread/ThreadLeftPanel/ModalDeleteAllThreads/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-macos-pr-target

There should be at least one empty line between import groups

Check failure on line 3 in web/screens/Thread/ThreadLeftPanel/ModalDeleteAllThreads/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-windows-pr-target

There should be at least one empty line between import groups
import useDeleteThread from '@/hooks/useDeleteThread'

Check failure on line 4 in web/screens/Thread/ThreadLeftPanel/ModalDeleteAllThreads/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-ubuntu-pr-target

There should be at least one empty line between import groups

Check failure on line 4 in web/screens/Thread/ThreadLeftPanel/ModalDeleteAllThreads/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-macos-pr-target

There should be at least one empty line between import groups

Check failure on line 4 in web/screens/Thread/ThreadLeftPanel/ModalDeleteAllThreads/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-windows-pr-target

There should be at least one empty line between import groups
import { modalActionThreadAtom, ThreadModalAction, threadsAtom } from '@/helpers/atoms/Thread.atom'
import { janDataFolderPathAtom } from '@/helpers/atoms/AppConfig.atom'
import {
modalActionThreadAtom,
ThreadModalAction,
threadsAtom,
} from '@/helpers/atoms/Thread.atom'

const ModalDeleteAllThreads = () => {
const { deleteAllThreads } = useDeleteThread()
const [modalActionThread, setModalActionThread] = useAtom(modalActionThreadAtom)
const [modalActionThread, setModalActionThread] = useAtom(
modalActionThreadAtom
)
const [threads] = useAtom(threadsAtom)
const janDataFolderPath = useAtomValue(janDataFolderPathAtom)

Expand All @@ -16,7 +22,7 @@ const ModalDeleteAllThreads = () => {
e.stopPropagation()
deleteAllThreads(threads)
},
[deleteAllThreads, threads, setModalActionThread]
[deleteAllThreads, threads]
)

const onCloseModal = useCallback(() => {
Expand All @@ -34,8 +40,10 @@ const ModalDeleteAllThreads = () => {
content={
<div>
<p className="text-[hsla(var(--text-secondary))]">
Are you sure you want to delete all chat history? This will remove all {threads.length} conversation
threads in <span className="font-mono">{janDataFolderPath}\threads</span> and cannot be undone.
Are you sure you want to delete all chat history? This will remove{' '}
all {threads.length} conversation threads in{' '}
<span className="font-mono">{janDataFolderPath}\threads</span> and
cannot be undone.
</p>
<div className="mt-4 flex justify-end gap-x-2">
<ModalClose asChild onClick={(e) => e.stopPropagation()}>
Expand Down

0 comments on commit a75bc6d

Please sign in to comment.