From e86b9dae4853fb058335c6c641381d44f4d1fd90 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 29 Mar 2023 22:02:12 +0000 Subject: [PATCH] Lint cleanup. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4250 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/ssb/tf-app.js | 4 ++-- apps/ssb/tf-compose.js | 21 +++++++++++---------- apps/ssb/tf-id-picker.js | 2 +- apps/ssb/tf-message.js | 10 +++++----- apps/ssb/tf-news.js | 2 +- apps/ssb/tf-profile.js | 4 ++-- apps/ssb/tf-tab-connections.js | 4 ++-- apps/ssb/tf-tab-news.js | 4 ++-- apps/ssb/tf-tab-search.js | 2 +- apps/ssb/tf-user.js | 2 +- 10 files changed, 28 insertions(+), 27 deletions(-) diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index 900a4e57..2be0bf5d 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -32,8 +32,8 @@ class TfElement extends LitElement { this.following = []; this.users = {}; this.loaded = false; - tfrpc.rpc.getBroadcasts().then(b => { self.broadcasts = b || [] }); - tfrpc.rpc.getConnections().then(c => { self.connections = c || [] }); + tfrpc.rpc.getBroadcasts().then(b => { self.broadcasts = b || []; }); + tfrpc.rpc.getConnections().then(c => { self.connections = c || []; }); tfrpc.rpc.getHash().then(hash => self.set_hash(hash)); tfrpc.register(function hashChanged(hash) { self.set_hash(hash); diff --git a/apps/ssb/tf-compose.js b/apps/ssb/tf-compose.js index ebf6ab73..3645d891 100644 --- a/apps/ssb/tf-compose.js +++ b/apps/ssb/tf-compose.js @@ -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`` + return html``; } else { - return html` this.apps = null}>` + return html` this.apps = null}>`; } } diff --git a/apps/ssb/tf-id-picker.js b/apps/ssb/tf-id-picker.js index 953093b8..900eeb6c 100644 --- a/apps/ssb/tf-id-picker.js +++ b/apps/ssb/tf-id-picker.js @@ -9,7 +9,7 @@ class TfIdentityPickerElement extends LitElement { return { ids: {type: Array}, selected: {type: String}, - } + }; } constructor() { diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index 54e2096c..40a48ec9 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -14,7 +14,7 @@ class TfMessageElement extends LitElement { raw: {type: Boolean}, blog_data: {type: String}, expanded: {type: Object}, - } + }; } static styles = styles; @@ -69,8 +69,8 @@ class TfMessageElement extends LitElement { hash: this.message?.hash, content: this.message?.content, signature: this.message?.signature, - } - return html`
${JSON.stringify(raw, null, 2)}
` + }; + return html`
${JSON.stringify(raw, null, 2)}
`; } vote(emoji) { @@ -229,7 +229,7 @@ class TfMessageElement extends LitElement { ${self.raw ? self.render_raw() : inner} ${self.render_votes()} - ` + `; } if (this.message?.type === 'contact_group') { return html` @@ -265,7 +265,7 @@ class TfMessageElement extends LitElement {
${unsafeHTML(tfutils.markdown(content.description))}
- ` + `; } let update = content.about == this.message.author ? html`
Updated profile.
` : diff --git a/apps/ssb/tf-news.js b/apps/ssb/tf-news.js index a9b00eb4..4678e87f 100644 --- a/apps/ssb/tf-news.js +++ b/apps/ssb/tf-news.js @@ -11,7 +11,7 @@ class TfNewsElement extends LitElement { following: {type: Array}, drafts: {type: Object}, expanded: {type: Object}, - } + }; } static styles = styles; diff --git a/apps/ssb/tf-profile.js b/apps/ssb/tf-profile.js index d485d64c..231349e3 100644 --- a/apps/ssb/tf-profile.js +++ b/apps/ssb/tf-profile.js @@ -11,7 +11,7 @@ class TfProfileElement extends LitElement { id: {type: String}, users: {type: Object}, size: {type: Number}, - } + }; } static styles = styles; @@ -33,7 +33,7 @@ class TfProfileElement extends LitElement { contact: this.id, }, change)).catch(function(error) { alert(error?.message); - }) + }); } follow() { diff --git a/apps/ssb/tf-tab-connections.js b/apps/ssb/tf-tab-connections.js index 613f4001..25a6d5b4 100644 --- a/apps/ssb/tf-tab-connections.js +++ b/apps/ssb/tf-tab-connections.js @@ -9,7 +9,7 @@ class TfTabConnectionsElement extends LitElement { connections: {type: Array}, stored_connections: {type: Array}, users: {type: Object}, - } + }; } constructor() { @@ -71,7 +71,7 @@ class TfTabConnectionsElement extends LitElement { ${this.render_connection_summary(connection)} - ` + `; } async forget_stored_connection(connection) { diff --git a/apps/ssb/tf-tab-news.js b/apps/ssb/tf-tab-news.js index 1fc5e45c..5e1c543f 100644 --- a/apps/ssb/tf-tab-news.js +++ b/apps/ssb/tf-tab-news.js @@ -12,7 +12,7 @@ class TfTabNewsFeedElement extends LitElement { messages: {type: Array}, drafts: {type: Object}, expanded: {type: Object}, - } + }; } static styles = styles; @@ -120,7 +120,7 @@ class TfTabNewsElement extends LitElement { following: {type: Array}, drafts: {type: Object}, expanded: {type: Object}, - } + }; } static styles = styles; diff --git a/apps/ssb/tf-tab-search.js b/apps/ssb/tf-tab-search.js index 93b3b9b2..165e6f50 100644 --- a/apps/ssb/tf-tab-search.js +++ b/apps/ssb/tf-tab-search.js @@ -9,7 +9,7 @@ class TfTabSearchElement extends LitElement { users: {type: Object}, following: {type: Array}, query: {type: String}, - } + }; } static styles = styles; diff --git a/apps/ssb/tf-user.js b/apps/ssb/tf-user.js index 99d87637..3b5fbc0e 100644 --- a/apps/ssb/tf-user.js +++ b/apps/ssb/tf-user.js @@ -7,7 +7,7 @@ class TfUserElement extends LitElement { return { id: {type: String}, users: {type: Object}, - } + }; } static styles = styles;