Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
10cfc85
1
Parent(s):
fce5dd0
minor: 删除历史记录时显示名称,空历史记录不弹窗
Browse files- ChuanhuChatbot.py +6 -5
ChuanhuChatbot.py
CHANGED
@@ -434,12 +434,13 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
434 |
)
|
435 |
historyRefreshBtn.click(**refresh_history_args)
|
436 |
historyDeleteBtn.click(delete_chat_history, [current_model, historyFileSelectDropdown, user_name], [status_display, historyFileSelectDropdown], _js='''function showConfirmationDialog(a, b, c) {
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
}
|
|
|
443 |
}''')
|
444 |
historyFileSelectDropdown.change(**load_history_from_file_args)
|
445 |
downloadFile.change(upload_chat_history, [current_model, downloadFile, user_name], [saveFileName, systemPromptTxt, chatbot])
|
|
|
434 |
)
|
435 |
historyRefreshBtn.click(**refresh_history_args)
|
436 |
historyDeleteBtn.click(delete_chat_history, [current_model, historyFileSelectDropdown, user_name], [status_display, historyFileSelectDropdown], _js='''function showConfirmationDialog(a, b, c) {
|
437 |
+
if (b != "") {
|
438 |
+
var result = confirm("你真的要删除 " + b + " 吗?");
|
439 |
+
if (result) {
|
440 |
+
return [a, b, c];
|
441 |
+
}
|
442 |
}
|
443 |
+
return [a, "CANCELED", c];
|
444 |
}''')
|
445 |
historyFileSelectDropdown.change(**load_history_from_file_args)
|
446 |
downloadFile.change(upload_chat_history, [current_model, downloadFile, user_name], [saveFileName, systemPromptTxt, chatbot])
|