format missed files

This commit is contained in:
emma 2023-07-05 02:35:36 -04:00
parent 8e880c349e
commit 13f92fa2b1
10 changed files with 52 additions and 47 deletions

View file

@ -423,8 +423,14 @@ const getNodeInfo = async ({ store }) => {
typeof federation.enabled === 'undefined' ? true : federation.enabled typeof federation.enabled === 'undefined' ? true : federation.enabled
}) })
store.dispatch('setInstanceOption', { name: 'publicTimelineVisibility', value: metadata.publicTimelineVisibility }) store.dispatch('setInstanceOption', {
store.dispatch('setInstanceOption', { name: 'federatedTimelineAvailable', value: metadata.federatedTimelineAvailable }) name: 'publicTimelineVisibility',
value: metadata.publicTimelineVisibility
})
store.dispatch('setInstanceOption', {
name: 'federatedTimelineAvailable',
value: metadata.federatedTimelineAvailable
})
const accountActivationRequired = metadata.accountActivationRequired const accountActivationRequired = metadata.accountActivationRequired
store.dispatch('setInstanceOption', { store.dispatch('setInstanceOption', {

View file

@ -4,7 +4,7 @@ import { library } from '@fortawesome/fontawesome-svg-core'
import { import {
publicTimelineVisible, publicTimelineVisible,
federatedTimelineVisible, federatedTimelineVisible,
bubbleTimelineVisible, bubbleTimelineVisible
} from '../../lib/timeline_visibility' } from '../../lib/timeline_visibility'
import { import {
faSignInAlt, faSignInAlt,
@ -135,7 +135,7 @@ export default {
...mapState({ ...mapState({
publicTimelineVisible, publicTimelineVisible,
federatedTimelineVisible, federatedTimelineVisible,
bubbleTimelineVisible, bubbleTimelineVisible
}) })
}, },
methods: { methods: {

View file

@ -44,9 +44,9 @@
/> />
</router-link> </router-link>
<router-link <router-link
v-if="publicTimelineVisible"
:to="{ name: 'public-timeline' }" :to="{ name: 'public-timeline' }"
class="nav-icon" class="nav-icon"
v-if="publicTimelineVisible"
> >
<FAIcon <FAIcon
fixed-width fixed-width
@ -68,9 +68,9 @@
/> />
</router-link> </router-link>
<router-link <router-link
v-if="federatedTimelineVisible"
:to="{ name: 'public-external-timeline' }" :to="{ name: 'public-external-timeline' }"
class="nav-icon" class="nav-icon"
v-if="federatedTimelineVisible"
> >
<FAIcon <FAIcon
fixed-width fixed-width

View file

@ -5,7 +5,7 @@ const EMOJI_REACTION_COUNT_CUTOFF = 12
const findEmojiByReplacement = (state, replacement) => { const findEmojiByReplacement = (state, replacement) => {
const allEmojis = state.instance.emoji.concat(state.instance.customEmoji) 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 = { const EmojiReactions = {

View file

@ -112,9 +112,7 @@
:placeholder="$t('settings.expire_posts_input_placeholder')" :placeholder="$t('settings.expire_posts_input_placeholder')"
/> />
</p> </p>
<p> <p></p>
</p>
<p> <p>
<interface-language-switcher <interface-language-switcher
:prompt-text="$t('settings.email_language')" :prompt-text="$t('settings.email_language')"

View file

@ -1,14 +1,12 @@
import Popover from '../popover/popover.vue' import Popover from '../popover/popover.vue'
import TimelineMenuContent from './timeline_menu_content.vue' import TimelineMenuContent from './timeline_menu_content.vue'
import { library } from '@fortawesome/fontawesome-svg-core' import { library } from '@fortawesome/fontawesome-svg-core'
import { import { faChevronDown } from '@fortawesome/free-solid-svg-icons'
faChevronDown
} from '@fortawesome/free-solid-svg-icons'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { import {
publicTimelineVisible, publicTimelineVisible,
federatedTimelineVisible, federatedTimelineVisible,
bubbleTimelineVisible, bubbleTimelineVisible
} from '../../lib/timeline_visibility' } from '../../lib/timeline_visibility'
library.add(faChevronDown) library.add(faChevronDown)
@ -42,14 +40,14 @@ const TimelineMenuTabs = {
} }
}, },
computed: { computed: {
privateMode () { privateMode() {
return this.$store.state.instance.private return this.$store.state.instance.private
}, },
...mapState({ ...mapState({
currentUser: state => state.users.currentUser, currentUser: (state) => state.users.currentUser,
publicTimelineVisible, publicTimelineVisible,
federatedTimelineVisible, federatedTimelineVisible,
bubbleTimelineVisible, bubbleTimelineVisible
}) })
}, },
methods: { methods: {

View file

@ -16,9 +16,9 @@
/> />
</router-link> </router-link>
<router-link <router-link
v-if="publicTimelineVisible"
:to="{ name: 'public-timeline' }" :to="{ name: 'public-timeline' }"
class="nav-icon" class="nav-icon"
v-if="publicTimelineVisible"
> >
<FAIcon <FAIcon
fixed-width fixed-width
@ -40,9 +40,9 @@
/> />
</router-link> </router-link>
<router-link <router-link
v-if="federatedTimelineVisible"
:to="{ name: 'public-external-timeline' }" :to="{ name: 'public-external-timeline' }"
class="nav-icon" class="nav-icon"
v-if="federatedTimelineVisible"
> >
<FAIcon <FAIcon
fixed-width fixed-width

View file

@ -21,7 +21,7 @@ const saveImmedeatelyActions = [
'setClientData', 'setClientData',
'setToken', 'setToken',
'clearToken', 'clearToken',
'emojiUsed', 'emojiUsed'
] ]
const defaultStorage = (() => { const defaultStorage = (() => {

View file

@ -1,23 +1,21 @@
const timelineVisibleUnauthenticated = (state, timeline) => ( const timelineVisibleUnauthenticated = (state, timeline) =>
state.instance.publicTimelineVisibility[timeline] ?? false 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) currentUser(state) || timelineVisibleUnauthenticated(state, timeline)
);
const federatedTimelineAvailable = (state) => state.instance.federatedTimelineAvailable; const federatedTimelineAvailable = (state) =>
state.instance.federatedTimelineAvailable
export const federatedTimelineVisible = (state) => ( export const federatedTimelineVisible = (state) =>
federatedTimelineAvailable(state) && currentUserOrTimelineVisibleUnauthenticated(state, 'federated') federatedTimelineAvailable(state) &&
); currentUserOrTimelineVisibleUnauthenticated(state, 'federated')
export const publicTimelineVisible = (state) => ( export const publicTimelineVisible = (state) =>
currentUserOrTimelineVisibleUnauthenticated(state, 'local') currentUserOrTimelineVisibleUnauthenticated(state, 'local')
);
export const bubbleTimelineVisible = (state) => ( export const bubbleTimelineVisible = (state) =>
state.instance.localBubbleInstances.length > 0 && currentUserOrTimelineVisibleUnauthenticated(state, 'bubble') state.instance.localBubbleInstances.length > 0 &&
); currentUserOrTimelineVisibleUnauthenticated(state, 'bubble')

View file

@ -3,14 +3,14 @@
const RECENT_MAX = 7 * 6 const RECENT_MAX = 7 * 6
const defaultState = { const defaultState = {
emojis: [], emojis: []
} }
const recentEmojis = { const recentEmojis = {
state: defaultState, state: defaultState,
mutations: { mutations: {
emojiUsed ({ emojis }, emoji) { emojiUsed({ emojis }, emoji) {
if (emoji.displayText === undefined || emoji.displayText === null) { if (emoji.displayText === undefined || emoji.displayText === null) {
console.error('emojiUsed was called with a bad emoji object: ', emoji) console.error('emojiUsed was called with a bad emoji object: ', emoji)
return return
@ -32,19 +32,24 @@ const recentEmojis = {
emojis.splice(i, 1) emojis.splice(i, 1)
emojis.unshift(emoji.displayText) emojis.unshift(emoji.displayText)
} }
}, }
}, },
getters: { getters: {
recentEmojis: (state, getters, rootState) => state.emojis.reduce((objects, displayText) => { recentEmojis: (state, getters, rootState) =>
const allEmojis = rootState.instance.emoji.concat(rootState.instance.customEmoji) state.emojis.reduce((objects, displayText) => {
let emojiObject = allEmojis.find(emoji => emoji.displayText === displayText) const allEmojis = rootState.instance.emoji.concat(
if (emojiObject !== undefined) { rootState.instance.customEmoji
objects.push(emojiObject) )
} let emojiObject = allEmojis.find(
return objects (emoji) => emoji.displayText === displayText
}, []), )
}, if (emojiObject !== undefined) {
objects.push(emojiObject)
}
return objects
}, [])
}
} }
export default recentEmojis export default recentEmojis