Merge remote-tracking branch 'upstream/develop' into feature/theming2

* upstream/develop:
  Fix iOS Safari from making videos play fullscreen by default
  added PR comments
  resolved the lint
  used the deleted data param as condition in status template
  Switch to "timeline" when pressing user-settings
  Added user setting tooltip
  made links in user bio always open in new tabs
  addressed PR comments
  added tooltip
  Add userId property to timelines so that we don't overwrite user timeline meant for another user
  Added option to auto-hide subject field when it's empty.
  removes hacks from notifications storage, adds api call to let server update is_seen attribute
  fixes vimium not giving retweet button a hint
  Do not use underscore at the beginning of the method
  Logout user on password change
  Route user to the correct profile URL
  Typo
  Fix filetype detection
  Switch to settings when touching settings
  Switch to timeline on nav panel actions
This commit is contained in:
Henry Jameson 2018-12-05 10:43:03 +03:00
commit 51cf4dc298
35 changed files with 134 additions and 52 deletions

View file

@ -29,6 +29,7 @@ const PROFILE_UPDATE_URL = '/api/account/update_profile.json'
const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json'
const QVITTER_USER_TIMELINE_URL = '/api/qvitter/statuses/user_timeline.json'
const QVITTER_USER_NOTIFICATIONS_URL = '/api/qvitter/statuses/notifications.json'
const QVITTER_USER_NOTIFICATIONS_READ_URL = '/api/qvitter/statuses/notifications/read.json'
const BLOCKING_URL = '/api/blocks/create.json'
const UNBLOCKING_URL = '/api/blocks/destroy.json'
const USER_URL = '/api/users/show.json'
@ -460,6 +461,18 @@ const suggestions = ({credentials}) => {
}).then((data) => data.json())
}
const markNotificationsAsSeen = ({id, credentials}) => {
const body = new FormData()
body.append('latest_id', id)
return fetch(QVITTER_USER_NOTIFICATIONS_READ_URL, {
body,
headers: authHeaders(credentials),
method: 'POST'
}).then((data) => data.json())
}
const apiService = {
verifyCredentials,
fetchTimeline,
@ -494,7 +507,8 @@ const apiService = {
fetchFollowRequests,
approveUser,
denyUser,
suggestions
suggestions,
markNotificationsAsSeen
}
export default apiService

View file

@ -9,11 +9,11 @@ const fileType = (typeString) => {
type = 'image'
}
if (typeString.match(/video\/(webm|mp4)/)) {
if (typeString.match(/video/)) {
type = 'video'
}
if (typeString.match(/audio|ogg/)) {
if (typeString.match(/audio/)) {
type = 'audio'
}

View file

@ -2,13 +2,14 @@ import { camelCase } from 'lodash'
import apiService from '../api/api.service.js'
const update = ({store, statuses, timeline, showImmediately}) => {
const update = ({store, statuses, timeline, showImmediately, userId}) => {
const ccTimeline = camelCase(timeline)
store.dispatch('setError', { value: false })
store.dispatch('addNewStatuses', {
timeline: ccTimeline,
userId,
statuses,
showImmediately
})
@ -33,7 +34,7 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
if (!older && statuses.length >= 20 && !timelineData.loading) {
store.dispatch('queueFlush', { timeline: timeline, id: timelineData.maxId })
}
update({store, statuses, timeline, showImmediately})
update({store, statuses, timeline, showImmediately, userId})
}, () => store.dispatch('setError', { value: true }))
}
@ -41,6 +42,7 @@ const startFetching = ({timeline = 'friends', credentials, store, userId = false
const rootState = store.rootState || store.state
const timelineData = rootState.statuses.timelines[camelCase(timeline)]
const showImmediately = timelineData.visibleStatuses.length === 0
timelineData.userId = userId
fetchAndUpdate({timeline, credentials, store, showImmediately, userId, tag})
const boundFetchAndUpdate = () => fetchAndUpdate({ timeline, credentials, store, userId, tag })
return setInterval(boundFetchAndUpdate, 10000)