aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorSean King <seanking2919@protonmail.com>2022-08-07 06:38:56 +0000
committerSean King <seanking2919@protonmail.com>2022-08-07 06:38:56 +0000
commit572f28d7c9efea4300cb88063baf4daab91e7910 (patch)
tree29d966a1b7141f6a768120497d3f34143f467212 /src/modules
parent18d69f93d38dc15a74db81ee4c10b4766bebfc35 (diff)
parent6a2f4270727913b8e5d4670b5b3bbc3f57f51ec5 (diff)
Merge branch 'fix/merge-conflicts/report-notifications' into 'feat/report-notification'
Fixing merge conflicts and lint for report notifications MR See merge request pleroma/pleroma-fe!1585
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/api.js4
-rw-r--r--src/modules/config.js4
-rw-r--r--src/modules/errors.js4
-rw-r--r--src/modules/serverSideConfig.js28
-rw-r--r--src/modules/statuses.js21
-rw-r--r--src/modules/users.js24
6 files changed, 44 insertions, 41 deletions
diff --git a/src/modules/api.js b/src/modules/api.js
index 54f94356..28f2076e 100644
--- a/src/modules/api.js
+++ b/src/modules/api.js
@@ -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)
},
diff --git a/src/modules/config.js b/src/modules/config.js
index c4b08390..cc72d60e 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -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)
}
diff --git a/src/modules/errors.js b/src/modules/errors.js
index ca89dc0f..d2e24100 100644
--- a/src/modules/errors.js
+++ b/src/modules/errors.js
@@ -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]
diff --git a/src/modules/serverSideConfig.js b/src/modules/serverSideConfig.js
index 4b73af26..476263bc 100644
--- a/src/modules/serverSideConfig.js
+++ b/src/modules/serverSideConfig.js
@@ -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
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 66cc82bc..f8e714cf 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -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 }) {
diff --git a/src/modules/users.js b/src/modules/users.js
index f951483f..13d4e318 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -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
}