feat(优化体验): 优化图片传输,保留侧栏滚动位置并支持页面跟随
build.yaml / build (push) Successful in 37s

This commit is contained in:
xiaoqidun committed 2026-09-14 22:53:38 +08:00
1 parent 59ab829a48
commit a9bd789bc4
4 files changed
+37 -12

No files matched your search

+2 -1
View File
@@ -67,7 +67,8 @@ async function handleMessage({ id, name, args }) {
await output.abort();
}
output = null;
self.postMessage({ id, ...result }, result.data?.bytes ? [result.data.bytes.buffer] : []);
const transfer = result.data?.bytes ? [result.data.bytes.buffer] : (result.data?.images || []).map((image) => image.bytes.buffer);
self.postMessage({ id, ...result }, transfer);
} catch (err) {
await output?.abort().catch(() => {});
const result = { id, ok: false, error: err.message };