mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +00:00
Revoke old camera image after new one has loaded (#2772)
This commit is contained in:
parent
da80bfa3c7
commit
3b008b6359
@ -167,15 +167,14 @@ class HuiImage extends LitElement {
|
||||
if (!this.hass || !this.cameraImage) {
|
||||
return;
|
||||
}
|
||||
if (this._cameraImageSrc) {
|
||||
URL.revokeObjectURL(this._cameraImageSrc);
|
||||
this._cameraImageSrc = undefined;
|
||||
}
|
||||
try {
|
||||
const { content_type: contentType, content } = await fetchThumbnail(
|
||||
this.hass,
|
||||
this.cameraImage
|
||||
);
|
||||
if (this._cameraImageSrc) {
|
||||
URL.revokeObjectURL(this._cameraImageSrc);
|
||||
}
|
||||
this._cameraImageSrc = URL.createObjectURL(
|
||||
b64toBlob(content, contentType)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user