From 13f92fa2b1794f2cc60f551b685eaad42405eacb Mon Sep 17 00:00:00 2001 From: emma Date: Wed, 5 Jul 2023 02:35:36 -0400 Subject: [PATCH] format missed files --- src/boot/after_store.js | 10 +++++-- src/components/desktop_nav/desktop_nav.js | 4 +-- src/components/desktop_nav/desktop_nav.vue | 4 +-- .../emoji_reactions/emoji_reactions.js | 2 +- .../settings_modal/tabs/profile_tab.vue | 4 +-- .../timeline_menu_tabs/timeline_menu_tabs.js | 12 ++++---- .../timeline_menu_tabs/timeline_menu_tabs.vue | 4 +-- src/lib/persisted_state.js | 2 +- src/lib/timeline_visibility.js | 28 +++++++++--------- src/modules/recentEmojis.js | 29 +++++++++++-------- 10 files changed, 52 insertions(+), 47 deletions(-) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index b20d3df6..d50f286c 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -423,8 +423,14 @@ const getNodeInfo = async ({ store }) => { typeof federation.enabled === 'undefined' ? true : federation.enabled }) - store.dispatch('setInstanceOption', { name: 'publicTimelineVisibility', value: metadata.publicTimelineVisibility }) - store.dispatch('setInstanceOption', { name: 'federatedTimelineAvailable', value: metadata.federatedTimelineAvailable }) + store.dispatch('setInstanceOption', { + name: 'publicTimelineVisibility', + value: metadata.publicTimelineVisibility + }) + store.dispatch('setInstanceOption', { + name: 'federatedTimelineAvailable', + value: metadata.federatedTimelineAvailable + }) const accountActivationRequired = metadata.accountActivationRequired store.dispatch('setInstanceOption', { diff --git a/src/components/desktop_nav/desktop_nav.js b/src/components/desktop_nav/desktop_nav.js index 6a007347..cf1f827b 100644 --- a/src/components/desktop_nav/desktop_nav.js +++ b/src/components/desktop_nav/desktop_nav.js @@ -4,7 +4,7 @@ import { library } from '@fortawesome/fontawesome-svg-core' import { publicTimelineVisible, federatedTimelineVisible, - bubbleTimelineVisible, + bubbleTimelineVisible } from '../../lib/timeline_visibility' import { faSignInAlt, @@ -135,7 +135,7 @@ export default { ...mapState({ publicTimelineVisible, federatedTimelineVisible, - bubbleTimelineVisible, + bubbleTimelineVisible }) }, methods: { diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue index 898e6884..ff4fc61a 100644 --- a/src/components/desktop_nav/desktop_nav.vue +++ b/src/components/desktop_nav/desktop_nav.vue @@ -44,9 +44,9 @@ /> { const allEmojis = state.instance.emoji.concat(state.instance.customEmoji) - return allEmojis.find(emoji => emoji.replacement === replacement) + return allEmojis.find((emoji) => emoji.replacement === replacement) } const EmojiReactions = { diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue index b5f47d6f..0f22303a 100644 --- a/src/components/settings_modal/tabs/profile_tab.vue +++ b/src/components/settings_modal/tabs/profile_tab.vue @@ -112,9 +112,7 @@ :placeholder="$t('settings.expire_posts_input_placeholder')" />

-

- -

+

state.users.currentUser, + currentUser: (state) => state.users.currentUser, publicTimelineVisible, federatedTimelineVisible, - bubbleTimelineVisible, + bubbleTimelineVisible }) }, methods: { diff --git a/src/components/timeline_menu_tabs/timeline_menu_tabs.vue b/src/components/timeline_menu_tabs/timeline_menu_tabs.vue index 70f05ca7..0f3c0b00 100644 --- a/src/components/timeline_menu_tabs/timeline_menu_tabs.vue +++ b/src/components/timeline_menu_tabs/timeline_menu_tabs.vue @@ -16,9 +16,9 @@ /> { diff --git a/src/lib/timeline_visibility.js b/src/lib/timeline_visibility.js index 379f6214..314d95cf 100644 --- a/src/lib/timeline_visibility.js +++ b/src/lib/timeline_visibility.js @@ -1,23 +1,21 @@ -const timelineVisibleUnauthenticated = (state, timeline) => ( - state.instance.publicTimelineVisibility[timeline] ?? false -); +const timelineVisibleUnauthenticated = (state, timeline) => + state.instance.publicTimelineVisibility[timeline] ?? false -const currentUser = (state) => state.users.currentUser; +const currentUser = (state) => state.users.currentUser -const currentUserOrTimelineVisibleUnauthenticated = (state, timeline) => ( +const currentUserOrTimelineVisibleUnauthenticated = (state, timeline) => currentUser(state) || timelineVisibleUnauthenticated(state, timeline) -); -const federatedTimelineAvailable = (state) => state.instance.federatedTimelineAvailable; +const federatedTimelineAvailable = (state) => + state.instance.federatedTimelineAvailable -export const federatedTimelineVisible = (state) => ( - federatedTimelineAvailable(state) && currentUserOrTimelineVisibleUnauthenticated(state, 'federated') -); +export const federatedTimelineVisible = (state) => + federatedTimelineAvailable(state) && + currentUserOrTimelineVisibleUnauthenticated(state, 'federated') -export const publicTimelineVisible = (state) => ( +export const publicTimelineVisible = (state) => currentUserOrTimelineVisibleUnauthenticated(state, 'local') -); -export const bubbleTimelineVisible = (state) => ( - state.instance.localBubbleInstances.length > 0 && currentUserOrTimelineVisibleUnauthenticated(state, 'bubble') -); +export const bubbleTimelineVisible = (state) => + state.instance.localBubbleInstances.length > 0 && + currentUserOrTimelineVisibleUnauthenticated(state, 'bubble') diff --git a/src/modules/recentEmojis.js b/src/modules/recentEmojis.js index baab1c52..f0019291 100644 --- a/src/modules/recentEmojis.js +++ b/src/modules/recentEmojis.js @@ -3,14 +3,14 @@ const RECENT_MAX = 7 * 6 const defaultState = { - emojis: [], + emojis: [] } const recentEmojis = { state: defaultState, mutations: { - emojiUsed ({ emojis }, emoji) { + emojiUsed({ emojis }, emoji) { if (emoji.displayText === undefined || emoji.displayText === null) { console.error('emojiUsed was called with a bad emoji object: ', emoji) return @@ -32,19 +32,24 @@ const recentEmojis = { emojis.splice(i, 1) emojis.unshift(emoji.displayText) } - }, + } }, getters: { - recentEmojis: (state, getters, rootState) => state.emojis.reduce((objects, displayText) => { - const allEmojis = rootState.instance.emoji.concat(rootState.instance.customEmoji) - let emojiObject = allEmojis.find(emoji => emoji.displayText === displayText) - if (emojiObject !== undefined) { - objects.push(emojiObject) - } - return objects - }, []), - }, + recentEmojis: (state, getters, rootState) => + state.emojis.reduce((objects, displayText) => { + const allEmojis = rootState.instance.emoji.concat( + rootState.instance.customEmoji + ) + let emojiObject = allEmojis.find( + (emoji) => emoji.displayText === displayText + ) + if (emojiObject !== undefined) { + objects.push(emojiObject) + } + return objects + }, []) + } } export default recentEmojis