Fix merge conflicts

This commit is contained in:
Sean King 2022-08-06 22:02:21 -06:00
commit dc9951d400
No known key found for this signature in database
GPG key ID: 510C52BACD6E7257
166 changed files with 2374 additions and 1602 deletions

View file

@ -233,7 +233,7 @@ const api = {
// Follow requests
startFetchingFollowRequests (store) {
if (store.state.fetchers['followRequests']) return
if (store.state.fetchers.followRequests) return
const fetcher = store.state.backendInteractor.startFetchingFollowRequests({ store })
store.commit('addFetcher', { fetcherName: 'followRequests', fetcher })
@ -244,7 +244,7 @@ const api = {
store.commit('removeFetcher', { fetcherName: 'followRequests', fetcher })
},
removeFollowRequest (store, request) {
let requests = store.state.followRequests.filter((it) => it !== request)
const requests = store.state.followRequests.filter((it) => it !== request)
store.commit('setFollowRequests', requests)
},

View file

@ -82,6 +82,8 @@ export const defaultState = {
useContainFit: true,
disableStickyHeaders: false,
showScrollbars: false,
userPopoverZoom: false,
userPopoverOverlay: true,
greentext: undefined, // instance default
useAtIcon: undefined, // instance default
mentionLinkDisplay: undefined, // instance default
@ -146,7 +148,7 @@ const config = {
const knownKeys = new Set(Object.keys(defaultState))
const presentKeys = new Set(Object.keys(data))
const intersection = new Set()
for (let elem of presentKeys) {
for (const elem of presentKeys) {
if (knownKeys.has(elem)) {
intersection.add(elem)
}

View file

@ -2,8 +2,8 @@ import { capitalize } from 'lodash'
export function humanizeErrors (errors) {
return Object.entries(errors).reduce((errs, [k, val]) => {
let message = val.reduce((acc, message) => {
let key = capitalize(k.replace(/_/g, ' '))
const message = val.reduce((acc, message) => {
const key = capitalize(k.replace(/_/g, ' '))
return acc + [key, message].join(' ') + '. '
}, '')
return [...errs, message]

View file

@ -39,53 +39,53 @@ const notificationsApi = ({ rootState, commit }, { path, value, oldValue }) => {
* If no api is specified, defaultApi is used (see above)
*/
export const settingsMap = {
'defaultScope': 'source.privacy',
'defaultNSFW': 'source.sensitive', // BROKEN: pleroma/pleroma#2837
'stripRichContent': {
defaultScope: 'source.privacy',
defaultNSFW: 'source.sensitive', // BROKEN: pleroma/pleroma#2837
stripRichContent: {
get: 'source.pleroma.no_rich_text',
set: 'no_rich_text'
},
// Privacy
'locked': 'locked',
'acceptChatMessages': {
locked: 'locked',
acceptChatMessages: {
get: 'pleroma.accepts_chat_messages',
set: 'accepts_chat_messages'
},
'allowFollowingMove': {
allowFollowingMove: {
get: 'pleroma.allow_following_move',
set: 'allow_following_move'
},
'discoverable': {
discoverable: {
get: 'source.pleroma.discoverable',
set: 'discoverable'
},
'hideFavorites': {
hideFavorites: {
get: 'pleroma.hide_favorites',
set: 'hide_favorites'
},
'hideFollowers': {
hideFollowers: {
get: 'pleroma.hide_followers',
set: 'hide_followers'
},
'hideFollows': {
hideFollows: {
get: 'pleroma.hide_follows',
set: 'hide_follows'
},
'hideFollowersCount': {
hideFollowersCount: {
get: 'pleroma.hide_followers_count',
set: 'hide_followers_count'
},
'hideFollowsCount': {
hideFollowsCount: {
get: 'pleroma.hide_follows_count',
set: 'hide_follows_count'
},
// NotificationSettingsAPIs
'webPushHideContents': {
webPushHideContents: {
get: 'pleroma.notification_settings.hide_notification_contents',
set: 'hide_notification_contents',
api: notificationsApi
},
'blockNotificationsFromStrangers': {
blockNotificationsFromStrangers: {
get: 'pleroma.notification_settings.block_from_strangers',
set: 'block_from_strangers',
api: notificationsApi

View file

@ -245,10 +245,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
}
const processors = {
'status': (status) => {
status: (status) => {
addStatus(status, showImmediately)
},
'retweet': (status) => {
retweet: (status) => {
// RetweetedStatuses are never shown immediately
const retweetedStatus = addStatus(status.retweeted_status, false, false)
@ -270,7 +270,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
retweet.retweeted_status = retweetedStatus
},
'favorite': (favorite) => {
favorite: (favorite) => {
// Only update if this is a new favorite.
// Ignore our own favorites because we get info about likes as response to like request
if (!state.favorites.has(favorite.id)) {
@ -278,7 +278,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
favoriteStatus(favorite)
}
},
'deletion': (deletion) => {
deletion: (deletion) => {
const uri = deletion.uri
const status = find(allStatuses, { uri })
if (!status) {
@ -292,10 +292,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
remove(timelineObject.visibleStatuses, { uri })
}
},
'follow': (follow) => {
follow: (follow) => {
// NOOP, it is known status but we don't do anything about it for now
},
'default': (unknown) => {
default: (unknown) => {
console.log('unknown status type')
console.log(unknown)
}
@ -303,7 +303,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
each(statuses, (status) => {
const type = status.type
const processor = processors[type] || processors['default']
const processor = processors[type] || processors.default
processor(status)
})
@ -345,6 +345,7 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
}
// Only add a new notification if we don't have one for the same action
// eslint-disable-next-line no-prototype-builtins
if (!state.notifications.idStore.hasOwnProperty(notification.id)) {
updateNotificationsMinMaxId(state, notification)
@ -526,7 +527,7 @@ export const mutations = {
},
addEmojiReactionsBy (state, { id, emojiReactions, currentUser }) {
const status = state.allStatusesObject[id]
status['emoji_reactions'] = emojiReactions
status.emoji_reactions = emojiReactions
},
addOwnReaction (state, { id, emoji, currentUser }) {
const status = state.allStatusesObject[id]
@ -547,7 +548,7 @@ export const mutations = {
if (reactionIndex >= 0) {
status.emoji_reactions[reactionIndex] = newReaction
} else {
status['emoji_reactions'] = [...status.emoji_reactions, newReaction]
status.emoji_reactions = [...status.emoji_reactions, newReaction]
}
},
removeOwnReaction (state, { id, emoji, currentUser }) {
@ -568,7 +569,7 @@ export const mutations = {
if (newReaction.count > 0) {
status.emoji_reactions[reactionIndex] = newReaction
} else {
status['emoji_reactions'] = status.emoji_reactions.filter(r => r.name !== emoji)
status.emoji_reactions = status.emoji_reactions.filter(r => r.name !== emoji)
}
},
updateStatusWithPoll (state, { id, poll }) {

View file

@ -103,23 +103,23 @@ export const mutations = {
const user = state.usersObject[id]
const tags = user.tags || []
const newTags = tags.concat([tag])
user['tags'] = newTags
user.tags = newTags
},
untagUser (state, { user: { id }, tag }) {
const user = state.usersObject[id]
const tags = user.tags || []
const newTags = tags.filter(t => t !== tag)
user['tags'] = newTags
user.tags = newTags
},
updateRight (state, { user: { id }, right, value }) {
const user = state.usersObject[id]
let newRights = user.rights
const newRights = user.rights
newRights[right] = value
user['rights'] = newRights
user.rights = newRights
},
updateActivationStatus (state, { user: { id }, deactivated }) {
const user = state.usersObject[id]
user['deactivated'] = deactivated
user.deactivated = deactivated
},
setCurrentUser (state, user) {
state.lastLoginName = user.screen_name
@ -148,13 +148,13 @@ export const mutations = {
clearFriends (state, userId) {
const user = state.usersObject[userId]
if (user) {
user['friendIds'] = []
user.friendIds = []
}
},
clearFollowers (state, userId) {
const user = state.usersObject[userId]
if (user) {
user['followerIds'] = []
user.followerIds = []
}
},
addNewUsers (state, users) {
@ -222,7 +222,7 @@ export const mutations = {
},
setColor (state, { user: { id }, highlighted }) {
const user = state.usersObject[id]
user['highlight'] = highlighted
user.highlight = highlighted
},
signUpPending (state) {
state.signUpPending = true
@ -393,7 +393,7 @@ const users = {
toggleActivationStatus ({ rootState, commit }, { user }) {
const api = user.deactivated ? rootState.api.backendInteractor.activateUser : rootState.api.backendInteractor.deactivateUser
api({ user })
.then((user) => { let deactivated = !user.is_active; commit('updateActivationStatus', { user, deactivated }) })
.then((user) => { const deactivated = !user.is_active; commit('updateActivationStatus', { user, deactivated }) })
},
registerPushNotifications (store) {
const token = store.state.currentUser.credentials
@ -457,17 +457,17 @@ const users = {
async signUp (store, userInfo) {
store.commit('signUpPending')
let rootState = store.rootState
const rootState = store.rootState
try {
let data = await rootState.api.backendInteractor.register(
const data = await rootState.api.backendInteractor.register(
{ params: { ...userInfo } }
)
store.commit('signUpSuccess')
store.commit('setToken', data.access_token)
store.dispatch('loginUser', data.access_token)
} catch (e) {
let errors = e.message
const errors = e.message
store.commit('signUpFailure', errors)
throw e
}