Lint cleanup.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4250 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-03-29 22:02:12 +00:00
parent 71de897419
commit e86b9dae48
10 changed files with 28 additions and 27 deletions

View File

@ -13,7 +13,7 @@ class TfComposeElement extends LitElement {
branch: {type: String},
apps: {type: Object},
drafts: {type: Object},
}
};
}
static styles = styles;
@ -56,7 +56,7 @@ class TfComposeElement extends LitElement {
if (!draft.mentions[link]) {
draft.mentions[link] = {
link: link,
}
};
}
draft.mentions[link].name = name.startsWith('@') ? name.substring(1) : name;
updated = true;
@ -111,7 +111,7 @@ class TfComposeElement extends LitElement {
let data_url = canvas.toDataURL(mime_type);
let result = atob(data_url.split(',')[1]).split('').map(x => x.charCodeAt(0));
resolve(result);
}
};
img.onerror = function(event) {
reject(new Error('Failed to load image.'));
};
@ -283,11 +283,11 @@ class TfComposeElement extends LitElement {
};
}
}
let draft = this.get_draft();
let draft = self.get_draft();
draft.mentions = Object.assign(draft.mentions || {}, mentions);
this.requestUpdate();
this.notify(draft);
this.apps = null;
self.requestUpdate();
self.notify(draft);
self.apps = null;
}
if (this.apps) {
@ -304,13 +304,14 @@ class TfComposeElement extends LitElement {
}
render_attach_app_button() {
let self = this;
async function attach_app() {
this.apps = await tfrpc.rpc.apps();
self.apps = await tfrpc.rpc.apps();
}
if (!this.apps) {
return html`<input type="button" value="Attach App" @click=${attach_app}></input>`
return html`<input type="button" value="Attach App" @click=${attach_app}></input>`;
} else {
return html`<input type="button" value="Discard App" @click=${() => this.apps = null}></input>`
return html`<input type="button" value="Discard App" @click=${() => this.apps = null}></input>`;
}
}