Merge branch 'develop' into feat/media-modal
This commit is contained in:
commit
c7cffbb6c7
32 changed files with 349 additions and 50 deletions
|
@ -130,7 +130,7 @@ const updateBanner = ({credentials, params}) => {
|
|||
// description
|
||||
const updateProfile = ({credentials, params}) => {
|
||||
// Always include these fields, because they might be empty or false
|
||||
const fields = ['description', 'locked', 'no_rich_text', 'hide_network']
|
||||
const fields = ['description', 'locked', 'no_rich_text', 'hide_followings', 'hide_followers']
|
||||
let url = PROFILE_UPDATE_URL
|
||||
|
||||
const form = new FormData()
|
||||
|
|
|
@ -100,7 +100,8 @@ export const parseUser = (data) => {
|
|||
output.rights = data.rights
|
||||
output.no_rich_text = data.no_rich_text
|
||||
output.default_scope = data.default_scope
|
||||
output.hide_network = data.hide_network
|
||||
output.hide_followings = data.hide_followings
|
||||
output.hide_followers = data.hide_followers
|
||||
output.background_image = data.background_image
|
||||
// on mastoapi this info is contained in a "relationship"
|
||||
output.following = data.following
|
||||
|
@ -215,6 +216,7 @@ export const parseStatus = (data) => {
|
|||
|
||||
output.id = String(data.id)
|
||||
output.visibility = data.visibility
|
||||
output.card = data.card
|
||||
output.created_at = new Date(data.created_at)
|
||||
|
||||
// Converting to string, the right way.
|
||||
|
|
9
src/services/mention_matcher/mention_matcher.js
Normal file
9
src/services/mention_matcher/mention_matcher.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
|
||||
export const mentionMatchesUrl = (attention, url) => {
|
||||
if (url === attention.statusnet_profile_url) {
|
||||
return true
|
||||
}
|
||||
const [namepart, instancepart] = attention.screen_name.split('@')
|
||||
const matchstring = new RegExp('://' + instancepart + '/.*' + namepart + '$', 'g')
|
||||
return !!url.match(matchstring)
|
||||
}
|
|
@ -24,6 +24,7 @@ const fetchAndUpdate = ({store, credentials, older = false}) => {
|
|||
return apiService.fetchTimeline(args)
|
||||
.then((notifications) => {
|
||||
update({store, notifications, older})
|
||||
return notifications
|
||||
}, () => store.dispatch('setNotificationsError', { value: true }))
|
||||
.catch(() => store.dispatch('setNotificationsError', { value: true }))
|
||||
}
|
||||
|
|
|
@ -29,12 +29,15 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
|
|||
args['userId'] = userId
|
||||
args['tag'] = tag
|
||||
|
||||
const numStatusesBeforeFetch = timelineData.statuses.length
|
||||
|
||||
return apiService.fetchTimeline(args)
|
||||
.then((statuses) => {
|
||||
if (!older && statuses.length >= 20 && !timelineData.loading && timelineData.statuses.length) {
|
||||
if (!older && statuses.length >= 20 && !timelineData.loading && numStatusesBeforeFetch > 0) {
|
||||
store.dispatch('queueFlush', { timeline: timeline, id: timelineData.maxId })
|
||||
}
|
||||
update({store, statuses, timeline, showImmediately, userId})
|
||||
return statuses
|
||||
}, () => store.dispatch('setError', { value: true }))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue