feat: show error when image preview fails (#2706)

This commit is contained in:
三咲雅 · Misaki Masa 2025-05-01 22:58:24 +08:00 committed by GitHub
parent 8ed569b729
commit d6a01a63ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 79 additions and 72 deletions

View file

@ -12,8 +12,9 @@ function M:peek(job)
end
ya.sleep(math.max(0, rt.preview.image_delay / 1000 + start - os.clock()))
ya.image_show(cache, job.area)
ya.preview_widgets(job, {})
local _, err = ya.image_show(cache, job.area)
ya.preview_widget(job, err and ui.Text(tostring(err)):wrap(ui.Text.WRAP))
end
function M:seek() end