mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
Fix manual hide apply and clear panel actions
This commit is contained in:
2
index.js
2
index.js
@@ -8663,6 +8663,8 @@ async function onReembedDirect() {
|
||||
testMemoryLLM: onTestMemoryLLM,
|
||||
fetchMemoryLLMModels: onFetchMemoryLLMModels,
|
||||
fetchEmbeddingModels: onFetchEmbeddingModels,
|
||||
applyCurrentHide: () => applyMessageHideNow("panel-manual-apply"),
|
||||
clearCurrentHide: () => clearAllHiddenMessages("panel-manual-clear"),
|
||||
rebuildVectorIndex: () => onRebuildVectorIndex(),
|
||||
rebuildVectorRange: (range) => onRebuildVectorIndex(range),
|
||||
reembedDirect: onReembedDirect,
|
||||
|
||||
25
panel.js
25
panel.js
@@ -2084,23 +2084,22 @@ function _bindConfigControls() {
|
||||
|
||||
document
|
||||
.getElementById("bme-apply-hide-settings")
|
||||
?.addEventListener("click", () => {
|
||||
const settings = _getSettings?.() || {};
|
||||
_patchSettings({
|
||||
hideOldMessagesEnabled: settings.hideOldMessagesEnabled ?? false,
|
||||
hideOldMessagesKeepLastN: settings.hideOldMessagesKeepLastN ?? 12,
|
||||
});
|
||||
?.addEventListener("click", async () => {
|
||||
const result = await _actionHandlers.applyCurrentHide?.();
|
||||
if (result?.error) {
|
||||
toastr.error(result.error, "ST-BME");
|
||||
return;
|
||||
}
|
||||
toastr.success("当前聊天的隐藏设置已重新应用", "ST-BME");
|
||||
});
|
||||
document
|
||||
.getElementById("bme-clear-hide-settings")
|
||||
?.addEventListener("click", () => {
|
||||
_patchSettings({
|
||||
hideOldMessagesEnabled: false,
|
||||
hideOldMessagesKeepLastN: 0,
|
||||
});
|
||||
_setCheckboxValue("bme-setting-hide-old-messages-enabled", false);
|
||||
_setInputValue("bme-setting-hide-old-messages-keep-last-n", 0);
|
||||
?.addEventListener("click", async () => {
|
||||
const result = await _actionHandlers.clearCurrentHide?.();
|
||||
if (result?.error) {
|
||||
toastr.error(result.error, "ST-BME");
|
||||
return;
|
||||
}
|
||||
toastr.info("已取消当前聊天里由 ST-BME 应用的隐藏", "ST-BME");
|
||||
});
|
||||
document
|
||||
|
||||
Reference in New Issue
Block a user