mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
refac
This commit is contained in:
parent
e0fc3e89a7
commit
6fdfa62845
1 changed files with 11 additions and 7 deletions
|
|
@ -308,15 +308,19 @@
|
||||||
|
|
||||||
// Helper function to maintain file paths within zip
|
// Helper function to maintain file paths within zip
|
||||||
const syncDirectoryHandler = async () => {
|
const syncDirectoryHandler = async () => {
|
||||||
const res = await resetKnowledgeById(localStorage.token, id).catch((e) => {
|
if ((knowledge?.files ?? []).length > 0) {
|
||||||
toast.error(e);
|
const res = await resetKnowledgeById(localStorage.token, id).catch((e) => {
|
||||||
});
|
toast.error(e);
|
||||||
|
});
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
knowledge = res;
|
knowledge = res;
|
||||||
toast.success($i18n.t('Knowledge reset successfully.'));
|
toast.success($i18n.t('Knowledge reset successfully.'));
|
||||||
|
|
||||||
// Upload directory
|
// Upload directory
|
||||||
|
uploadDirectoryHandler();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
uploadDirectoryHandler();
|
uploadDirectoryHandler();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue