mirror of
https://github.com/multipleof4/sune.git
synced 2026-01-13 16:17:55 +00:00
This build was committed by a bot.
This commit is contained in:
@@ -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);
|
||||
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -12,7 +12,7 @@
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/cash-dom/dist/cash.min.js"></script>
|
||||
<script defer src="//unpkg.com/alpinejs"></script>
|
||||
|
||||
<script type="module" crossorigin src="/assets/index-D2PsxKpZ.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-wl164bZZ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CZ8Js0gk.css">
|
||||
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
||||
<body class="bg-white text-gray-900 selection:bg-black/10" x-data @click.window="if($event.target.closest('button')) haptic(); if(!document.getElementById('threadPopover').contains($event.target)&&!$event.target.closest('[data-thread-menu]')) hideThreadPopover(); if(!document.getElementById('sunePopover').contains($event.target)&&!$event.target.closest('[data-sune-menu]')) hideSunePopover(); if(!document.getElementById('userMenu').contains($event.target)&&!document.getElementById('userMenuBtn').contains($event.target)) document.getElementById('userMenu').classList.add('hidden')">
|
||||
|
||||
2
dist/sw.js
vendored
2
dist/sw.js
vendored
@@ -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")))});
|
||||
|
||||
Reference in New Issue
Block a user