feat(lora-cycler): reset execution state on manual index change

Reset execution state when user manually changes LoRA index to ensure next execution starts from the user-set index. This prevents stale execution state from interfering with user-initiated index changes.
This commit is contained in:
Will Miao
2026-01-31 09:04:26 +08:00
parent 60df2df324
commit 66babf9ee1
3 changed files with 12 additions and 3 deletions

View File

@@ -56,6 +56,12 @@ const getPoolConfig = (): LoraPoolConfig | null => {
// Handle index update from user
const handleIndexUpdate = async (newIndex: number) => {
// Reset execution state when user manually changes index
// This ensures the next execution starts from the user-set index
;(props.widget as any)[HAS_EXECUTED] = false
state.executionIndex.value = null
state.nextIndex.value = null
state.setIndex(newIndex)
// Refresh list to update current LoRA display

View File

@@ -1684,7 +1684,7 @@ to {
opacity: 1;
}
.lora-cycler-widget[data-v-6c9d29f9] {
.lora-cycler-widget[data-v-2ca548b3] {
padding: 6px;
background: rgba(40, 44, 52, 0.6);
border-radius: 6px;
@@ -13082,6 +13082,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
return null;
};
const handleIndexUpdate = async (newIndex) => {
props.widget[HAS_EXECUTED] = false;
state.executionIndex.value = null;
state.nextIndex.value = null;
state.setIndex(newIndex);
try {
const poolConfig = getPoolConfig();
@@ -13210,7 +13213,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
};
}
});
const LoraCyclerWidget = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-6c9d29f9"]]);
const LoraCyclerWidget = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-2ca548b3"]]);
const _hoisted_1$1 = { class: "json-display-widget" };
const _hoisted_2$1 = {
class: "json-content",

File diff suppressed because one or more lines are too long