ssb: Enough plumbing that if a blob is received, we will try to load the image again.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m24s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m24s
This commit is contained in:
@@ -45,11 +45,14 @@ class TfMessageElement extends LitElement {
|
||||
connectedCallback() {
|
||||
super.connectedCallback();
|
||||
this._click_callback = this.document_click.bind(this);
|
||||
this._blob_stored = this.blob_stored.bind(this);
|
||||
document.body.addEventListener('mouseup', this._click_callback);
|
||||
window.addEventListener('blob-stored', this._blob_stored);
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback();
|
||||
window.removeEventListener('blob-stored', this._blob_stored);
|
||||
document.body.removeEventListener('mouseup', this._click_callback);
|
||||
}
|
||||
|
||||
@@ -61,6 +64,16 @@ class TfMessageElement extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
blob_stored(event) {
|
||||
let search = `/${event.detail.id}/view`;
|
||||
for (let img of this.shadowRoot.querySelectorAll('img')) {
|
||||
if (img.src.indexOf(search) != -1) {
|
||||
let src = img.src.split('?')[0];
|
||||
img.src = `${src}?${new Date().valueOf()}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
show_reply() {
|
||||
let event = new CustomEvent('tf-draft', {
|
||||
bubbles: true,
|
||||
|
Reference in New Issue
Block a user