mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-29 08:51:27 -03:00
fix(recipes): render reconnect form for hash-invalid LoRAs in recipe modal
The Reconnect action button was rendered for both deleted and hash-invalid (Unresolvable Hash) LoRA entries, but the .lora-reconnect-container input form was only rendered for deleted ones. Clicking Reconnect on a hash-invalid item silently did nothing because showReconnectInput() could not find the container. Align the container render condition with the button condition, and extend the resource-items test to assert the form opens on click.
This commit is contained in:
@@ -960,7 +960,7 @@ class RecipeModal {
|
|||||||
${lora.baseModel ? `<div class="base-model">${lora.baseModel}</div>` : ''}
|
${lora.baseModel ? `<div class="base-model">${lora.baseModel}</div>` : ''}
|
||||||
</div>
|
</div>
|
||||||
${actionsRow}
|
${actionsRow}
|
||||||
${isDeleted ? `
|
${isDeleted || lora.hashInvalid ? `
|
||||||
<div class="lora-reconnect-container" data-lora-index="${loraIndex}">
|
<div class="lora-reconnect-container" data-lora-index="${loraIndex}">
|
||||||
<div class="reconnect-instructions">
|
<div class="reconnect-instructions">
|
||||||
<p>Enter LoRA Syntax or Name to Reconnect:</p>
|
<p>Enter LoRA Syntax or Name to Reconnect:</p>
|
||||||
|
|||||||
@@ -342,7 +342,13 @@ describe('RecipeModal resource item interactions', () => {
|
|||||||
expect(badge.textContent).toContain('Unresolvable Hash');
|
expect(badge.textContent).toContain('Unresolvable Hash');
|
||||||
|
|
||||||
expect(invalidItem.querySelector('.lora-download')).toBeNull();
|
expect(invalidItem.querySelector('.lora-download')).toBeNull();
|
||||||
expect(invalidItem.querySelector('.lora-reconnect')).not.toBeNull();
|
const reconnectButton = invalidItem.querySelector('.lora-reconnect');
|
||||||
|
expect(reconnectButton).not.toBeNull();
|
||||||
|
|
||||||
|
reconnectButton.click();
|
||||||
|
const container = invalidItem.querySelector('.lora-reconnect-container');
|
||||||
|
expect(container).not.toBeNull();
|
||||||
|
expect(container.classList.contains('active')).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('marks the entry hash-invalid when hash resolution returns Model not found', async () => {
|
it('marks the entry hash-invalid when hash resolution returns Model not found', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user