fix: error invoking remote method readdirsync (#2505)
This commit is contained in:
parent
8f230f330b
commit
84e1b09e84
@ -75,7 +75,7 @@ export default class JanAssistantExtension extends AssistantExtension {
|
||||
fileName,
|
||||
])
|
||||
|
||||
if (filePath.includes('.DS_Store')) continue
|
||||
if (!(await fs.fileStat(filePath))?.isDirectory) continue
|
||||
const jsonFiles: string[] = (await fs.readdirSync(filePath)).filter(
|
||||
(file: string) => file === 'assistant.json'
|
||||
)
|
||||
|
||||
@ -111,8 +111,7 @@ export default class JSONConversationalExtension extends ConversationalExtension
|
||||
threadDirPath,
|
||||
JSONConversationalExtension._threadMessagesFileName,
|
||||
])
|
||||
if (!(await fs.existsSync(threadDirPath)))
|
||||
await fs.mkdir(threadDirPath)
|
||||
if (!(await fs.existsSync(threadDirPath))) await fs.mkdir(threadDirPath)
|
||||
|
||||
if (message.content[0]?.type === 'image') {
|
||||
const filesPath = await joinPath([threadDirPath, 'files'])
|
||||
@ -218,11 +217,11 @@ export default class JSONConversationalExtension extends ConversationalExtension
|
||||
|
||||
const threadDirs: string[] = []
|
||||
for (let i = 0; i < fileInsideThread.length; i++) {
|
||||
if (fileInsideThread[i].includes('.DS_Store')) continue
|
||||
const path = await joinPath([
|
||||
JSONConversationalExtension._threadFolder,
|
||||
fileInsideThread[i],
|
||||
])
|
||||
if (!(await fs.fileStat(path))?.isDirectory) continue
|
||||
|
||||
const isHavingThreadInfo = (await fs.readdirSync(path)).includes(
|
||||
JSONConversationalExtension._threadInfoFileName
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user