diff --git a/src/components/chat_message/chat_message.js b/src/components/chat_message/chat_message.js index 516741a33..8e5df8b1e 100644 --- a/src/components/chat_message/chat_message.js +++ b/src/components/chat_message/chat_message.js @@ -76,9 +76,7 @@ const ChatMessage = { return !!this.message.user }, authorId() { - return this.isStatus - ? this.message.user.id - : this.message.account_id + return this.isStatus ? this.message.user.id : this.message.account_id }, author() { return this.$store.getters.findUser(this.authorId) diff --git a/src/components/chat_view/chat_view.js b/src/components/chat_view/chat_view.js index 8d45707f3..f2b5618ed 100644 --- a/src/components/chat_view/chat_view.js +++ b/src/components/chat_view/chat_view.js @@ -27,8 +27,8 @@ import { readChat, sendChatMessage, } from 'src/api/chats.js' -import { WSConnectionStatus } from 'src/api/websocket.js' import { fetchConversation, fetchStatus } from 'src/api/public.js' +import { WSConnectionStatus } from 'src/api/websocket.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faChevronDown, faChevronLeft } from '@fortawesome/free-solid-svg-icons' @@ -180,11 +180,20 @@ const Chat = { }, $route: async function (newVal) { if (this.messagesIndex[newVal.params.statusId]) { - const focused = document.getElementById(`chatmessage-${this.$route.params.statusId}`) + const focused = document.getElementById( + `chatmessage-${this.$route.params.statusId}`, + ) if (focused?.getBoundingClientRect == null) return - const bottomBoundary = window.innerHeight - this.$refs.footer.clientHeight - const topBoundary = this.$refs.header.clientHeight + document.getElementById('nav').clientHeight - const margin = Number(window.getComputedStyle(this.$refs.messageList.$el).gap.replace('px','')) + const bottomBoundary = + window.innerHeight - this.$refs.footer.clientHeight + const topBoundary = + this.$refs.header.clientHeight + + document.getElementById('nav').clientHeight + const margin = Number( + window + .getComputedStyle(this.$refs.messageList.$el) + .gap.replace('px', ''), + ) const rect = focused.getBoundingClientRect() const scrollAmount = (() => { @@ -293,7 +302,9 @@ const Chat = { if (this.isConversation) { const [ { data: status }, - { data: { ancestors, descendants } } + { + data: { ancestors, descendants }, + }, ] = await Promise.all([ fetchStatus({ id: this.statusId, @@ -302,7 +313,7 @@ const Chat = { fetchConversation({ id: this.statusId, credentials: useOAuthStore().token, - }) + }), ]) messages = [...ancestors, status, ...descendants] } else { @@ -378,7 +389,7 @@ const Chat = { const message = newMessages[i] // Sanity check - if (!this.isConversation && (message.chat_id !== this.chat.id)) { + if (!this.isConversation && message.chat_id !== this.chat.id) { console.warn( `Chat message doesn't belong to current chat (id: ${this.chat.id})!!`, message, @@ -516,7 +527,10 @@ const Chat = { // Event handlers onPosted(data) { this.explicitReplyStatus = null - this.$router.push({ name: 'conversation2', params: { statusId: data.id } }) + this.$router.push({ + name: 'conversation2', + params: { statusId: data.id }, + }) }, handleVisibilityChange() { this.$nextTick(() => { diff --git a/src/components/scope_selector/scope_selector.js b/src/components/scope_selector/scope_selector.js index 77eb4e791..0df50031d 100644 --- a/src/components/scope_selector/scope_selector.js +++ b/src/components/scope_selector/scope_selector.js @@ -82,13 +82,13 @@ const ScopeSelector = { changeVis(scope) { this.currentScope = scope this.$emit('change', scope) - } + }, }, watch: { originalScope(newVal) { this.currentScope = newVal - } - } + }, + }, } export default ScopeSelector diff --git a/src/components/status_action_buttons/action_button.js b/src/components/status_action_buttons/action_button.js index fe3cd3ed6..842944965 100644 --- a/src/components/status_action_buttons/action_button.js +++ b/src/components/status_action_buttons/action_button.js @@ -17,21 +17,21 @@ import { faCheck, faChevronDown, faChevronRight, + faComments, faExternalLinkAlt, faEye, faEyeSlash, faHistory, faMinus, + faPencil, faPlus, faReply, faRetweet, faShareAlt, faStar, faThumbtack, - faPencil, faTimes, faWrench, - faComments, } from '@fortawesome/free-solid-svg-icons' library.add(