Merge remote-tracking branch 'upstream/develop' into settings-refactor
* upstream/develop: (89 commits) remove needless ref show preview popover when hover numbered replies refactor conditions do not make too many nested div add fetchStatus action refactor status loading logic split status preview popover into a separate component uninstall mobile-detect library listen both events minor css fix restrict distance at top side only set different trigger event in desktop and mobile by default fix eslint warnings fix popper go behind the top bar migrate Popper to v-popover fix popper go behind the top bar fix eslint warnings reset font-size to normal text size using rem use top placement by default hide status preview popper when hover popper content ...
This commit is contained in:
commit
b66564a30d
67 changed files with 857 additions and 495 deletions
|
@ -219,10 +219,16 @@ const authHeaders = (accessToken) => {
|
|||
}
|
||||
}
|
||||
|
||||
const followUser = ({ id, credentials }) => {
|
||||
const followUser = ({ id, credentials, ...options }) => {
|
||||
let url = MASTODON_FOLLOW_URL(id)
|
||||
const form = {}
|
||||
if (options.reblogs !== undefined) { form['reblogs'] = options.reblogs }
|
||||
return fetch(url, {
|
||||
headers: authHeaders(credentials),
|
||||
body: JSON.stringify(form),
|
||||
headers: {
|
||||
...authHeaders(credentials),
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
method: 'POST'
|
||||
}).then((data) => data.json())
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ const backendInteractorService = credentials => {
|
|||
return apiService.fetchUserRelationship({ id, credentials })
|
||||
}
|
||||
|
||||
const followUser = (id) => {
|
||||
return apiService.followUser({ credentials, id })
|
||||
const followUser = ({ id, reblogs }) => {
|
||||
return apiService.followUser({ credentials, id, reblogs })
|
||||
}
|
||||
|
||||
const unfollowUser = (id) => {
|
||||
|
|
|
@ -69,6 +69,7 @@ export const parseUser = (data) => {
|
|||
output.following = relationship.following
|
||||
output.statusnet_blocking = relationship.blocking
|
||||
output.muted = relationship.muting
|
||||
output.showing_reblogs = relationship.showing_reblogs
|
||||
output.subscribed = relationship.subscribing
|
||||
}
|
||||
|
||||
|
@ -196,9 +197,11 @@ export const parseAttachment = (data) => {
|
|||
return output
|
||||
}
|
||||
export const addEmojis = (string, emojis) => {
|
||||
const matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g
|
||||
return emojis.reduce((acc, emoji) => {
|
||||
const regexSafeShortCode = emoji.shortcode.replace(matchOperatorsRegex, '\\$&')
|
||||
return acc.replace(
|
||||
new RegExp(`:${emoji.shortcode}:`, 'g'),
|
||||
new RegExp(`:${regexSafeShortCode}:`, 'g'),
|
||||
`<img src='${emoji.url}' alt='${emoji.shortcode}' title='${emoji.shortcode}' class='emoji' />`
|
||||
)
|
||||
}, string)
|
||||
|
|
|
@ -14,7 +14,7 @@ const fetchUser = (attempt, user, store) => new Promise((resolve, reject) => {
|
|||
})
|
||||
|
||||
export const requestFollow = (user, store) => new Promise((resolve, reject) => {
|
||||
store.state.api.backendInteractor.followUser(user.id)
|
||||
store.state.api.backendInteractor.followUser({ id: user.id })
|
||||
.then((updated) => {
|
||||
store.commit('updateUserRelationship', [updated])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue