From a3c4c18cc0b9892a0516a941f75f9fb61f13d83d Mon Sep 17 00:00:00 2001 From: dragongoose Date: Mon, 15 Sep 2025 21:30:21 -0400 Subject: [PATCH] format --- src/assets/messageParser.ts | 4 +- src/components/CategoryPreview.vue | 4 +- src/components/FollowButton.vue | 8 +-- src/components/TwitchChat.vue | 36 +++++++------ src/components/VodChat.vue | 62 ++++++++++++---------- src/components/popups/ShareButtonModal.vue | 2 +- src/registerServiceWorker.js | 2 - src/types/Chat.ts | 2 +- src/views/CategoryView.vue | 12 ++--- src/views/FollowingView.vue | 12 ++--- src/views/HomepageView.vue | 33 ++++++------ src/views/SearchPageView.vue | 2 +- src/views/SettingsView.vue | 6 +-- src/views/VodView.vue | 1 - 14 files changed, 96 insertions(+), 90 deletions(-) diff --git a/src/assets/messageParser.ts b/src/assets/messageParser.ts index 90c3651..3de15a0 100644 --- a/src/assets/messageParser.ts +++ b/src/assets/messageParser.ts @@ -94,7 +94,7 @@ export function parseRawMessage(rawMessage: string, allBadges: Badge[]): Message } } - return message; + return message } default: @@ -123,4 +123,4 @@ export function parseRawBadges(rb: string, allBadges: Badge[]): Badge[] { } return foundBadges -} \ No newline at end of file +} diff --git a/src/components/CategoryPreview.vue b/src/components/CategoryPreview.vue index 71c66ed..dadc42a 100644 --- a/src/components/CategoryPreview.vue +++ b/src/components/CategoryPreview.vue @@ -31,7 +31,9 @@ export default {
-

+

{{ category.displayName }}

{{ abbreviate(category.viewers) }} viewers

diff --git a/src/components/FollowButton.vue b/src/components/FollowButton.vue index 415d1b0..c35afbc 100644 --- a/src/components/FollowButton.vue +++ b/src/components/FollowButton.vue @@ -34,7 +34,7 @@ export default { * @returns true if streamer was followed, false if streamer was already followed. */ followStreamer(username: string): boolean { - let follows = getFollows() + const follows = getFollows() if (follows.includes(username)) return false follows.push(username) @@ -48,7 +48,7 @@ export default { * @returns true if unfollowed, false if not followed. */ unfollowStreamer(username: string): boolean { - let follows = getFollows() + const follows = getFollows() const index = follows.indexOf(username) if (index === -1) return false @@ -59,10 +59,10 @@ export default { } }, mounted() { - let followerData = localStorage.getItem('following') + const followerData = localStorage.getItem('following') if (!followerData) return - let following: string[] = JSON.parse(followerData) + const following: string[] = JSON.parse(followerData) const isFollower = following.includes(this.$props.username) if (isFollower) { diff --git a/src/components/TwitchChat.vue b/src/components/TwitchChat.vue index 268309a..72e6544 100644 --- a/src/components/TwitchChat.vue +++ b/src/components/TwitchChat.vue @@ -7,7 +7,6 @@ import { getEndpoint } from '@/mixins' import type { Badge, Message } from '@/assets/types' - export default { props: { channelName: { @@ -32,20 +31,20 @@ export default { } }, async mounted() { - const chatStatusMessage = this.$refs.initConnectingStatus as Element - this.ws!.onmessage = (message) => { - if (message.data == 'OK') { - chatStatusMessage.textContent = this.$t('chat.connected', { username: this.channelName }) - } else { - this.messages.push(parseRawMessage(message.data, this.badges)) - this.clearMessages() - this.scrollToBottom() - } + const chatStatusMessage = this.$refs.initConnectingStatus as Element + this.ws!.onmessage = (message) => { + if (message.data == 'OK') { + chatStatusMessage.textContent = this.$t('chat.connected', { username: this.channelName }) + } else { + this.messages.push(parseRawMessage(message.data, this.badges)) + this.clearMessages() + this.scrollToBottom() } + } - this.ws!.onopen = () => { - this.ws!.send('JOIN ' + this.$props.channelName?.toLowerCase()) - } + this.ws!.onopen = () => { + this.ws!.send('JOIN ' + this.$props.channelName?.toLowerCase()) + } /* await getEndpoint(`api/chat/${this.$props.channelName}/history`).then((data) => { @@ -80,9 +79,7 @@ export default { }