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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue