diff --git a/dist/assets/index-D2PsxKpZ.js b/dist/assets/index-wl164bZZ.js similarity index 99% rename from dist/assets/index-D2PsxKpZ.js rename to dist/assets/index-wl164bZZ.js index c9666fc..24921ea 100644 --- a/dist/assets/index-D2PsxKpZ.js +++ b/dist/assets/index-wl164bZZ.js @@ -1487,12 +1487,13 @@ async function syncActiveThread() { const prevText = bubble.textContent || ""; const j = await fetch(HTTP_BASE + "?uid=" + encodeURIComponent(id)).then((r) => r.ok ? r.json() : null).catch(() => null); const finalise = (t, c, imgs) => { - renderMarkdown(bubble, t, { enhance: false }); + const tempMsg = { content: c, images: imgs }; + renderMarkdown(bubble, partsToText(tempMsg), { enhance: false }); enhanceCodeBlocks(bubble, true); const i = state.messages.findIndex((x) => x.id === id); if (i >= 0) { state.messages[i].content = c; - if (imgs) state.messages[i].images = imgs; + state.messages[i].images = imgs; } else state.messages.push({ id, role: "assistant", content: c, images: imgs, ...activeMeta() }); THREAD.persist(); setBtnSend(); @@ -1509,7 +1510,8 @@ async function syncActiveThread() { return false; } const text = j.text || "", isDone = j.error || j.done || j.phase === "done"; - if (text) renderMarkdown(bubble, text, { enhance: false }); + const display = partsToText({ content: [{ type: "text", text }], images: j.images }); + if (display) renderMarkdown(bubble, display, { enhance: false }); if (isDone) { const finalText = text || prevText; finalise(finalText, [{ type: "text", text: finalText }], j.images); diff --git a/dist/index.html b/dist/index.html index 08d12aa..0ae1a92 100644 --- a/dist/index.html +++ b/dist/index.html @@ -12,7 +12,7 @@ - + diff --git a/dist/sw.js b/dist/sw.js index 00baf2b..5c52ccf 100644 --- a/dist/sw.js +++ b/dist/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const c=e=>i(e,t),l={module:{uri:t},exports:o,require:c};s[t]=Promise.all(n.map(e=>l[e]||c(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"91cf4d206da72ce6b35505e517f0476b"},{url:"assets/index-D2PsxKpZ.js",revision:null},{url:"assets/index-CZ8Js0gk.css",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const c=e=>i(e,t),l={module:{uri:t},exports:o,require:c};s[t]=Promise.all(n.map(e=>l[e]||c(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"651cd1c0e45dc8ee12f9b894a978d638"},{url:"assets/index-wl164bZZ.js",revision:null},{url:"assets/index-CZ8Js0gk.css",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});