mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
fix: upon successful training of newly uploaded src doc, the latest doc is auto set as selected doc
This commit is contained in:
@@ -104,7 +104,14 @@ export default function Upload({
|
||||
.then((data) => {
|
||||
if (data.status == 'SUCCESS') {
|
||||
if (data.result.limited === true) {
|
||||
getDocs().then((data) => dispatch(setSourceDocs(data)));
|
||||
getDocs().then((data) => {
|
||||
dispatch(setSourceDocs(data));
|
||||
dispatch(
|
||||
setSelectedDocs(
|
||||
data?.find((d) => d.location.toLowerCase() === 'local'),
|
||||
),
|
||||
);
|
||||
});
|
||||
setProgress(
|
||||
(progress) =>
|
||||
progress && {
|
||||
@@ -114,7 +121,14 @@ export default function Upload({
|
||||
},
|
||||
);
|
||||
} else {
|
||||
getDocs().then((data) => dispatch(setSourceDocs(data)));
|
||||
getDocs().then((data) => {
|
||||
dispatch(setSourceDocs(data));
|
||||
dispatch(
|
||||
setSelectedDocs(
|
||||
data?.find((d) => d.location.toLowerCase() === 'local'),
|
||||
),
|
||||
);
|
||||
});
|
||||
setProgress(
|
||||
(progress) =>
|
||||
progress && {
|
||||
|
||||
Reference in New Issue
Block a user