mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-12 01:59:34 -05:00
fix(components): add type guards and assertions in TipTap.vue
- Add HTMLImageElement instanceof check before accessing src property - Add type assertions for getBlobUrl return value and cache access
This commit is contained in:
@@ -274,17 +274,17 @@ const CustomImage = Image.extend({
|
||||
|
||||
const img = document.getElementById(id)
|
||||
|
||||
if (!img) return
|
||||
if (!img || !(img instanceof HTMLImageElement)) return
|
||||
|
||||
if (typeof loadedAttachments.value[cacheKey] === 'undefined') {
|
||||
|
||||
const attachment = new AttachmentModel({taskId: taskId, id: attachmentId})
|
||||
|
||||
const attachmentService = new AttachmentService()
|
||||
loadedAttachments.value[cacheKey] = await attachmentService.getBlobUrl(attachment)
|
||||
loadedAttachments.value[cacheKey] = await attachmentService.getBlobUrl(attachment) as string
|
||||
}
|
||||
|
||||
img.src = loadedAttachments.value[cacheKey]
|
||||
img.src = loadedAttachments.value[cacheKey] as string
|
||||
})
|
||||
|
||||
return ['img', mergeAttributes(this.options.HTMLAttributes, {
|
||||
|
||||
Reference in New Issue
Block a user