mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
fix: 允许删除内置块,仅保护兼容块
- 删除按钮 disabled 条件从 non-custom 改为 legacyPrompt - 后端守卫同步更新,内置块可删除,兼容块禁止删除
This commit is contained in:
6
panel.js
6
panel.js
@@ -2206,7 +2206,7 @@ function _renderTaskBlockListItem(block, index, state) {
|
||||
data-task-action="delete-block"
|
||||
data-block-id="${_escHtml(block.id)}"
|
||||
type="button"
|
||||
${block.type === "custom" ? "" : "disabled"}
|
||||
${block.type === "legacyPrompt" ? "disabled" : ""}
|
||||
>
|
||||
删除
|
||||
</button>
|
||||
@@ -2661,8 +2661,8 @@ function _deleteTaskBlock(blockId) {
|
||||
const index = blocks.findIndex((item) => item.id === blockId);
|
||||
if (index < 0) return null;
|
||||
const block = blocks[index];
|
||||
if (block.type !== "custom") {
|
||||
toastr.info("只有自定义块可以删除", "ST-BME");
|
||||
if (block.type === "legacyPrompt") {
|
||||
toastr.info("兼容块不可删除", "ST-BME");
|
||||
return null;
|
||||
}
|
||||
blocks.splice(index, 1);
|
||||
|
||||
Reference in New Issue
Block a user