Don't bother sending a RemoteUrl for DM images if they're not downloaded yet, since they can't be loaded without an authentication token anyway

This commit is contained in:
Alessio 2024-12-22 08:07:26 -08:00
parent 5c79decd7b
commit 8d29e25823

View File

@ -37,12 +37,10 @@
</div> </div>
{{end}} {{end}}
{{range .Images}} {{range .Images}}
{{/* DM images can only be loaded with an authenticated session. So sending the RemoteUrl
in an <img> tag is not useful; it will just HTTP 401 */}}
<img class="dm-message__embedded-image" <img class="dm-message__embedded-image"
{{if .IsDownloaded}} src="/content/images/{{.LocalFilename}}"
src="/content/images/{{.LocalFilename}}"
{{else}}
src="{{.RemoteURL}}"
{{end}}
width="{{.Width}}" height="{{.Height}}" width="{{.Width}}" height="{{.Height}}"
onclick="image_carousel.querySelector('img').src = this.src; image_carousel.showModal();" onclick="image_carousel.querySelector('img').src = this.src; image_carousel.showModal();"
> >