Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
da455e40
Commit
da455e40
authored
Jul 26, 2023
by
JzoNg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix state of preview switching
parent
97c06617
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
index.tsx
web/app/components/datasets/create/step-two/index.tsx
+4
-7
No files found.
web/app/components/datasets/create/step-two/index.tsx
View file @
da455e40
...
...
@@ -401,18 +401,15 @@ const StepTwo = ({
setAutomaticFileIndexingEstimate
(
null
)
setShowPreview
()
fetchFileIndexingEstimate
()
setPreviewSwitched
(
false
)
}
else
{
hidePreview
()
setCustomFileIndexingEstimate
(
null
)
setPreviewSwitched
(
false
)
}
},
[
segmentationType
,
indexType
])
useEffect
(()
=>
{
if
(
docForm
===
DocForm
.
TEXT
)
setPreviewSwitched
(
false
)
},
[
docForm
])
return
(
<
div
className=
'flex w-full h-full'
>
<
div
ref=
{
scrollRef
}
className=
'relative h-full w-full overflow-y-scroll'
>
...
...
@@ -680,14 +677,14 @@ const StepTwo = ({
)
}
</
div
>
<
div
className=
'my-4 px-8 space-y-4'
>
{
previewSwitched
&&
fileIndexingEstimate
?.
qa_preview
&&
(
{
previewSwitched
&&
docForm
===
DocForm
.
QA
&&
fileIndexingEstimate
?.
qa_preview
&&
(
<>
{
fileIndexingEstimate
?.
qa_preview
.
map
((
item
,
index
)
=>
(
<
PreviewItem
type=
{
PreviewType
.
QA
}
key=
{
item
.
question
}
qa=
{
item
}
index=
{
index
+
1
}
/>
))
}
</>
)
}
{
!
previewSwitched
&&
fileIndexingEstimate
?.
preview
&&
(
{
(
docForm
===
DocForm
.
TEXT
||
!
previewSwitched
)
&&
fileIndexingEstimate
?.
preview
&&
(
<>
{
fileIndexingEstimate
?.
preview
.
map
((
item
,
index
)
=>
(
<
PreviewItem
type=
{
PreviewType
.
TEXT
}
key=
{
item
}
content=
{
item
}
index=
{
index
+
1
}
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment