fix(frontend): preserve URN download panel container
This commit is contained in:
@@ -5205,6 +5205,14 @@ test('local match refreshes preserve keyed rows and button handlers', () => {
|
||||
assert.doesNotMatch(wireLocalMatchButtons, /addEventListener\('click'/);
|
||||
});
|
||||
|
||||
test('URN resolution preserves the download panel container', () => {
|
||||
const resolveUrnAsync = extractMethod(resolveDownloadMethodsSource, 'resolveUrnAsync');
|
||||
|
||||
assert.doesNotMatch(resolveUrnAsync, /downloadEl\.outerHTML\s*=/);
|
||||
assert.match(resolveUrnAsync, /downloadEl\.innerHTML\s*=\s*this\.renderKnownDownloadPanel/);
|
||||
assert.match(resolveUrnAsync, /wireDownloadSearchPanel\(downloadEl, missing\)/);
|
||||
});
|
||||
|
||||
test('local match status group warns when match folder is unsupported by node', () => {
|
||||
const renderLocalMatchStatus = eval(`(${extractMethod(searchPanelMethodsSource, 'renderLocalMatchStatus')})`);
|
||||
const getLocalMatchCategory = eval(`(${extractMethod(searchPanelMethodsSource, 'getLocalMatchCategory')})`);
|
||||
|
||||
@@ -2873,9 +2873,8 @@ export const resolveDownloadMethods = {
|
||||
if (missing) {
|
||||
this.applyCivitaiUrnResult(missing, data.civitai);
|
||||
this.refreshSearchBaseModelLabels?.();
|
||||
const downloadParent = downloadEl.parentElement;
|
||||
downloadEl.outerHTML = this.renderKnownDownloadPanel(missing, missing.download_source);
|
||||
this.wireDownloadSearchPanel(downloadParent || this.contentElement, missing);
|
||||
downloadEl.innerHTML = this.renderKnownDownloadPanel(missing, missing.download_source);
|
||||
this.wireDownloadSearchPanel(downloadEl, missing);
|
||||
this.refreshUrnLocalMatches(missing);
|
||||
}
|
||||
} else if (downloadEl) {
|
||||
|
||||
Reference in New Issue
Block a user