more getters migrated
This commit is contained in:
parent
f77e1225b5
commit
7738ce87e6
8 changed files with 19 additions and 13 deletions
|
|
@ -136,7 +136,7 @@ const EmojiInput = {
|
|||
return useSyncConfigStore().mergedConfig.padEmoji
|
||||
},
|
||||
defaultCandidateIndex() {
|
||||
return this.$store.getters.mergedConfig.autocompleteSelect ? 0 : -1
|
||||
return useSyncConfigStore().mergedConfig.autocompleteSelect ? 0 : -1
|
||||
},
|
||||
preText() {
|
||||
return this.modelValue.slice(0, this.caret)
|
||||
|
|
@ -165,7 +165,7 @@ const EmojiInput = {
|
|||
},
|
||||
languages() {
|
||||
return ensureFinalFallback(
|
||||
this.$store.getters.mergedConfig.interfaceLanguage,
|
||||
useSyncConfigStore().mergedConfig.interfaceLanguage,
|
||||
)
|
||||
},
|
||||
maybeLocalizedEmojiNamesAndKeywords() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import { defineAsyncComponent } from 'vue'
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import { mapState as mapPiniaState } from 'pinia'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
import {
|
||||
highlightClass,
|
||||
|
|
@ -156,7 +158,7 @@ const MentionLink = {
|
|||
shouldFadeDomain() {
|
||||
return this.mergedConfig.mentionLinkFadeDomain
|
||||
},
|
||||
...mapGetters(['mergedConfig']),
|
||||
...mapPiniaState(useSyncConfigStore, ['mergedConfig']),
|
||||
...mapState({
|
||||
currentUser: (state) => state.users.currentUser,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { useEditStatusStore } from 'src/stores/editStatus.js'
|
||||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { useReportsStore } from 'src/stores/reports.js'
|
||||
import { useStatusHistoryStore } from 'src/stores/statusHistory.js'
|
||||
|
|
@ -52,7 +53,7 @@ export const BUTTONS = [
|
|||
!PRIVATE_SCOPES.has(status.visibility)),
|
||||
toggleable: true,
|
||||
confirm: ({ status, getters }) =>
|
||||
!status.repeated && getters.mergedConfig.modalOnRepeat,
|
||||
!status.repeated && useSyncConfigStore().mergedConfig.modalOnRepeat,
|
||||
confirmStrings: {
|
||||
title: 'status.repeat_confirm_title',
|
||||
body: 'status.repeat_confirm',
|
||||
|
|
@ -227,7 +228,7 @@ export const BUTTONS = [
|
|||
currentUser.privileges.includes('messages_delete'))
|
||||
)
|
||||
},
|
||||
confirm: ({ getters }) => getters.mergedConfig.modalOnDelete,
|
||||
confirm: ({ getters }) => useSyncConfigStore().mergedConfig.modalOnDelete,
|
||||
confirmStrings: {
|
||||
title: 'status.delete_confirm_title',
|
||||
body: 'status.delete_confirm',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import * as DateUtils from 'src/services/date_utils/date_utils.js'
|
||||
import localeService from 'src/services/locale/locale.service.js'
|
||||
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
export default {
|
||||
name: 'Timeago',
|
||||
props: ['time', 'autoUpdate', 'longFormat', 'nowThreshold', 'templateKey'],
|
||||
|
|
@ -13,17 +15,17 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
shouldUseAbsoluteTimeFormat() {
|
||||
if (!this.$store.getters.mergedConfig.useAbsoluteTimeFormat) {
|
||||
if (!useSyncConfigStore().mergedConfig.useAbsoluteTimeFormat) {
|
||||
return false
|
||||
}
|
||||
return (
|
||||
DateUtils.durationStrToMs(
|
||||
this.$store.getters.mergedConfig.absoluteTimeFormatMinAge,
|
||||
useSyncConfigStore().mergedConfig.absoluteTimeFormatMinAge,
|
||||
) <= this.relativeTimeMs
|
||||
)
|
||||
},
|
||||
time12hFormat() {
|
||||
return this.$store.getters.mergedConfig.absoluteTimeFormat12h === '12h'
|
||||
return useSyncConfigStore().mergedConfig.absoluteTimeFormat12h === '12h'
|
||||
},
|
||||
browserLocale() {
|
||||
return localeService.internalToBrowserLocale(this.$i18n.locale)
|
||||
|
|
|
|||
|
|
@ -682,7 +682,6 @@ const users = {
|
|||
useInterfaceStore().setLastTimeline('public-timeline')
|
||||
useInterfaceStore().setLayoutWidth(windowWidth())
|
||||
useInterfaceStore().setLayoutHeight(windowHeight())
|
||||
//useSyncConfigStore().clearSyncConfig()
|
||||
})
|
||||
},
|
||||
loginUser(store, accessToken) {
|
||||
|
|
@ -780,7 +779,7 @@ const users = {
|
|||
dispatch('startFetchingFollowRequests')
|
||||
}
|
||||
|
||||
if (store.getters.mergedConfig.useStreamingApi) {
|
||||
if (useSyncConfigStore().mergedConfig.useStreamingApi) {
|
||||
dispatch('fetchTimeline', { timeline: 'friends', since: null })
|
||||
dispatch('fetchNotifications', { since: null })
|
||||
dispatch('enableMastoSockets', true)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { promiseInterval } from '../promise_interval/promise_interval.js'
|
|||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
const update = ({ store, notifications, older }) => {
|
||||
store.dispatch('addNewNotifications', { notifications, older })
|
||||
|
|
@ -29,7 +30,7 @@ const fetchAndUpdate = ({ store, credentials, older = false, since }) => {
|
|||
const { getters } = store
|
||||
const rootState = store.rootState || store.state
|
||||
const timelineData = rootState.notifications
|
||||
const hideMutedPosts = getters.mergedConfig.hideMutedPosts
|
||||
const hideMutedPosts = useSyncConfigStore().mergedConfig.hideMutedPosts
|
||||
|
||||
if (useInstanceCapabilitiesStore().pleromaChatMessagesAvailable) {
|
||||
mastoApiNotificationTypes.add('pleroma:chat_mention')
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { promiseInterval } from '../promise_interval/promise_interval.js'
|
|||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
const update = ({
|
||||
store,
|
||||
|
|
@ -46,7 +47,7 @@ const fetchAndUpdate = ({
|
|||
const rootState = store.rootState || store.state
|
||||
const { getters } = store
|
||||
const timelineData = rootState.statuses.timelines[camelCase(timeline)]
|
||||
const { hideMutedPosts, replyVisibility } = getters.mergedConfig
|
||||
const { hideMutedPosts, replyVisibility } = useSyncConfigStore().mergedConfig
|
||||
const loggedIn = !!rootState.users.currentUser
|
||||
|
||||
if (older) {
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
|
||||
const mobileLayout = width <= 800
|
||||
const normalOrMobile = mobileLayout ? 'mobile' : 'normal'
|
||||
const { thirdColumnMode } = window.vuex.getters.mergedConfig
|
||||
const { thirdColumnMode } = useSyncConfigStore().mergedConfig
|
||||
if (thirdColumnMode === 'none' || !window.vuex.state.users.currentUser) {
|
||||
this.layoutType = normalOrMobile
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue