mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 14:07:55 +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) {
|
if (!this.hass || !this.cameraImage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this._cameraImageSrc) {
|
|
||||||
URL.revokeObjectURL(this._cameraImageSrc);
|
|
||||||
this._cameraImageSrc = undefined;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
const { content_type: contentType, content } = await fetchThumbnail(
|
const { content_type: contentType, content } = await fetchThumbnail(
|
||||||
this.hass,
|
this.hass,
|
||||||
this.cameraImage
|
this.cameraImage
|
||||||
);
|
);
|
||||||
|
if (this._cameraImageSrc) {
|
||||||
|
URL.revokeObjectURL(this._cameraImageSrc);
|
||||||
|
}
|
||||||
this._cameraImageSrc = URL.createObjectURL(
|
this._cameraImageSrc = URL.createObjectURL(
|
||||||
b64toBlob(content, contentType)
|
b64toBlob(content, contentType)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user