Merge branch 'develop' into setttingssync
This commit is contained in:
commit
3530830b07
134 changed files with 1411 additions and 1299 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import isEqual from 'lodash/isEqual'
|
||||
import merge from 'lodash/merge'
|
||||
import ldUnescape from 'lodash/unescape'
|
||||
import { mapState } from 'pinia'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||
|
|
@ -26,8 +25,8 @@ import UserNote from '../user_note/user_note.vue'
|
|||
|
||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { usePostStatusStore } from 'src/stores/post_status'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
import { propsToNative } from 'src/services/attributes_helper/attributes_helper.service.js'
|
||||
import localeService from 'src/services/locale/locale.service.js'
|
||||
|
|
@ -182,7 +181,7 @@ export default {
|
|||
return false
|
||||
},
|
||||
groupActorAvailable() {
|
||||
return useInstanceStore().groupActorAvailable
|
||||
return useInstanceCapabilitiesStore().groupActorAvailable
|
||||
},
|
||||
availableActorTypes() {
|
||||
return this.groupActorAvailable
|
||||
|
|
@ -214,15 +213,6 @@ export default {
|
|||
)
|
||||
return Math.round(this.user.statuses_count / days)
|
||||
},
|
||||
userHighlight() {
|
||||
console.log(
|
||||
'UH',
|
||||
this.userHighlightData,
|
||||
this.userHighlightIndex,
|
||||
this.test,
|
||||
)
|
||||
return this.userHighlightData[this.user.screen_name.replace(/\./g, '_')]
|
||||
},
|
||||
emoji() {
|
||||
return useEmojiStore().customEmoji.map((e) => ({
|
||||
shortcode: e.displayText,
|
||||
|
|
@ -232,43 +222,39 @@ export default {
|
|||
},
|
||||
userHighlightType: {
|
||||
get() {
|
||||
return this.userHighlight?.type || 'disabled'
|
||||
const data =
|
||||
this.$store.getters.mergedConfig.highlight[this.user.screen_name]
|
||||
return (data && data.type) || 'disabled'
|
||||
},
|
||||
set(type) {
|
||||
const data =
|
||||
this.$store.getters.mergedConfig.highlight[this.user.screen_name]
|
||||
if (type !== 'disabled') {
|
||||
useSyncConfigStore().addCollectionPreference({
|
||||
path: 'objectCollections.userUserHighlight',
|
||||
value: {
|
||||
_key: this.user.screen_name.replace(/\./g, '_'),
|
||||
color: this.userHighlight?.color || '#FFFFFF',
|
||||
type,
|
||||
},
|
||||
this.$store.dispatch('setHighlight', {
|
||||
user: this.user.screen_name,
|
||||
color: (data && data.color) || '#FFFFFF',
|
||||
type,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
} else {
|
||||
useSyncConfigStore().removeCollectionPreference({
|
||||
path: 'objectCollections.userUserHighlight',
|
||||
value: { _key: this.user.screen_name.replace(/\./g, '_') },
|
||||
this.$store.dispatch('setHighlight', {
|
||||
user: this.user.screen_name,
|
||||
color: undefined,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
}
|
||||
},
|
||||
...mapGetters(['mergedConfig']),
|
||||
},
|
||||
userHighlightColor: {
|
||||
get() {
|
||||
return this.userHighlight?.color
|
||||
const data =
|
||||
this.$store.getters.mergedConfig.highlight[this.user.screen_name]
|
||||
return data && data.color
|
||||
},
|
||||
set(color) {
|
||||
console.log(this.userHighlight)
|
||||
useSyncConfigStore().addCollectionPreference({
|
||||
path: 'objectCollections.userUserHighlight',
|
||||
value: {
|
||||
_key: this.user.screen_name.replace(/\./g, '_'),
|
||||
color,
|
||||
type: this.userHighlight?.type || 'solid',
|
||||
},
|
||||
this.$store.dispatch('setHighlight', {
|
||||
user: this.user.screen_name,
|
||||
color,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
},
|
||||
},
|
||||
visibleRole() {
|
||||
|
|
@ -354,10 +340,16 @@ export default {
|
|||
return this.newBanner === null ? currentUrl : newUrl
|
||||
},
|
||||
defaultAvatar() {
|
||||
return useInstanceStore().server + useInstanceStore().defaultAvatar
|
||||
return (
|
||||
useInstanceStore().server +
|
||||
useInstanceStore().instanceIdentity.defaultAvatar
|
||||
)
|
||||
},
|
||||
defaultBanner() {
|
||||
return useInstanceStore().server + useInstanceStore().defaultBanner
|
||||
return (
|
||||
useInstanceStore().server +
|
||||
useInstanceStore().instanceIdentity.defaultBanner
|
||||
)
|
||||
},
|
||||
isDefaultAvatar() {
|
||||
const baseAvatar = useInstanceStore().defaultAvatar
|
||||
|
|
@ -376,7 +368,7 @@ export default {
|
|||
)
|
||||
},
|
||||
fieldsLimits() {
|
||||
return useInstanceStore().fieldsLimits
|
||||
return useInstanceStore().limits.fieldsLimits
|
||||
},
|
||||
maxFields() {
|
||||
return this.fieldsLimits ? this.fieldsLimits.maxFields : 0
|
||||
|
|
@ -398,17 +390,7 @@ export default {
|
|||
],
|
||||
})
|
||||
},
|
||||
...mapState(useSyncConfigStore, {
|
||||
test: (store) => store.prefsStorage.objectCollections.userHighlight,
|
||||
userHighlightData: (store) =>
|
||||
store.prefsStorage.objectCollections.userHighlight.data,
|
||||
userHighlightIndex: (store) =>
|
||||
store.prefsStorage.objectCollections.userHighlight.index,
|
||||
hideUserStats: (store) => store.mergedConfig.hideUserStats,
|
||||
userCardLeftJustify: (store) => store.mergedConfig.userCardLeftJustify,
|
||||
userCardHidePersonalMarks: (store) =>
|
||||
store.mergedConfig.userCardHidePersonalMarks,
|
||||
}),
|
||||
...mapGetters(['mergedConfig']),
|
||||
},
|
||||
methods: {
|
||||
muteUser() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue