fix: clear logs should not delete the folder (#4806)
This commit is contained in:
parent
74f6682263
commit
39e5649454
@ -1 +1 @@
|
||||
1.0.11-rc8
|
||||
1.0.11-rc9
|
||||
|
||||
@ -7,19 +7,15 @@ import {
|
||||
ArrowLeftIcon,
|
||||
DownloadIcon,
|
||||
FileJson,
|
||||
RefreshCwIcon,
|
||||
SettingsIcon,
|
||||
} from 'lucide-react'
|
||||
|
||||
import Spinner from '@/containers/Loader/Spinner'
|
||||
import ModelDownloadButton from '@/containers/ModelDownloadButton'
|
||||
|
||||
import ModelLabel from '@/containers/ModelLabel'
|
||||
|
||||
import { MainViewState } from '@/constants/screens'
|
||||
|
||||
import { useRefreshModelList } from '@/hooks/useEngineManagement'
|
||||
|
||||
import { MarkdownTextMessage } from '@/screens/Thread/ThreadCenterPanel/TextMessage/MarkdownTextMessage'
|
||||
|
||||
import { toGigabytes } from '@/utils/converter'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { fs } from '@janhq/core'
|
||||
import { fs, joinPath } from '@janhq/core'
|
||||
import { Button, Input, ScrollArea, Switch } from '@janhq/joi'
|
||||
import { useAtom, useAtomValue } from 'jotai'
|
||||
import { FolderOpenIcon } from 'lucide-react'
|
||||
@ -22,7 +22,9 @@ const Privacy = () => {
|
||||
*/
|
||||
const clearLogs = async () => {
|
||||
try {
|
||||
await fs.rm(`file://logs`)
|
||||
for (const file of await fs.readdirSync(`file://logs`)) {
|
||||
await fs.rm(await joinPath(['file://logs', file]))
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error clearing logs: ', err)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user