fix tests
This commit is contained in:
parent
6aadf5f1c6
commit
3cdcb87831
11 changed files with 165 additions and 82 deletions
|
|
@ -214,6 +214,15 @@ 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,
|
||||
|
|
@ -223,35 +232,43 @@ export default {
|
|||
},
|
||||
userHighlightType: {
|
||||
get() {
|
||||
const data = this.highlight[this.user.screen_name]
|
||||
return (data && data.type) || 'disabled'
|
||||
return this.userHighlight?.type || 'disabled'
|
||||
},
|
||||
set(type) {
|
||||
const data = this.highlight[this.user.screen_name]
|
||||
if (type !== 'disabled') {
|
||||
this.$store.dispatch('setHighlight', {
|
||||
user: this.user.screen_name,
|
||||
color: (data && data.color) || '#FFFFFF',
|
||||
type,
|
||||
useSyncConfigStore().addCollectionPreference({
|
||||
path: 'objectCollections.userUserHighlight',
|
||||
value: {
|
||||
_key: this.user.screen_name.replace(/\./g, '_'),
|
||||
color: this.userHighlight?.color || '#FFFFFF',
|
||||
type,
|
||||
},
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
} else {
|
||||
this.$store.dispatch('setHighlight', {
|
||||
user: this.user.screen_name,
|
||||
color: undefined,
|
||||
useSyncConfigStore().removeCollectionPreference({
|
||||
path: 'objectCollections.userUserHighlight',
|
||||
value: { _key: this.user.screen_name.replace(/\./g, '_') },
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
}
|
||||
},
|
||||
},
|
||||
userHighlightColor: {
|
||||
get() {
|
||||
const data = this.highlight[this.user.screen_name]
|
||||
return data && data.color
|
||||
return this.userHighlight?.color
|
||||
},
|
||||
set(color) {
|
||||
this.$store.dispatch('setHighlight', {
|
||||
user: this.user.screen_name,
|
||||
color,
|
||||
console.log(this.userHighlight)
|
||||
useSyncConfigStore().addCollectionPreference({
|
||||
path: 'objectCollections.userUserHighlight',
|
||||
value: {
|
||||
_key: this.user.screen_name.replace(/\./g, '_'),
|
||||
color,
|
||||
type: this.userHighlight?.type || 'solid',
|
||||
},
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
},
|
||||
},
|
||||
visibleRole() {
|
||||
|
|
@ -382,6 +399,11 @@ 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) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue