0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-21 15:48:59 +01:00

Add error toast to auto-load comment expansion path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
silverwind 2026-02-20 13:43:12 +01:00
parent 5e936bd3c5
commit db03128bf9
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443

View File

@ -258,7 +258,12 @@ async function onLocationHashChange() {
const attrAutoLoadClicked = 'data-auto-load-clicked';
if (expandButton.hasAttribute(attrAutoLoadClicked)) return;
expandButton.setAttribute(attrAutoLoadClicked, 'true');
await fetchBlobExcerpt(expandButton.closest('tr')!, expandButton.getAttribute('data-url')!);
try {
await fetchBlobExcerpt(expandButton.closest('tr')!, expandButton.getAttribute('data-url')!);
} catch (err) {
showErrorToast(`Failed to expand: ${err.message}`);
return;
}
continue; // Try again to find the element
}
}