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