mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-21 00:11:26 +02:00
fix: references bug
fix
This commit is contained in:
@@ -111,12 +111,23 @@
|
||||
// Load content if needed
|
||||
if (!tooltipContent) {
|
||||
fetch(`/chat/reference/${encodeURIComponent(reference)}`)
|
||||
.then(response => response.text())
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`reference lookup failed with status ${response.status}`);
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(html => {
|
||||
tooltipContent = html;
|
||||
if (document.getElementById(tooltipId)) {
|
||||
document.getElementById(tooltipId).innerHTML = html;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
tooltipContent = '<div class="text-xs opacity-70">Reference unavailable.</div>';
|
||||
if (document.getElementById(tooltipId)) {
|
||||
document.getElementById(tooltipId).innerHTML = tooltipContent;
|
||||
}
|
||||
});
|
||||
} else if (tooltip) {
|
||||
// Set content if already loaded
|
||||
|
||||
Reference in New Issue
Block a user