Merge remote-tracking branch 'upstream/develop' into emoji-selector-update

* upstream/develop: (42 commits)
  Fix formatting in oc.json
  avoid using global class
  fix logo moving bug when lightbox is open
  Reserve scrollbar gap when body scroll is locked
  setting display: initial makes trouble, instead, toggle display: none using classname
  lock body scroll
  add body-scroll-lock directive
  install body-scroll-lock
  wire up props with PostStatusModal
  rename component
  recover autofocusing behavior
  refactor MobilePostStatusModal using new PostStatusModal
  add new module and modal to post new status
  remove needless condition
  add mention button
  wire up user state with global store
  collapse fav/repeat notifications from muted users
  do not collapse thread muted posts in conversation
  detect thread-muted posts
  do not change word based muting logic
  ...
This commit is contained in:
Henry Jameson 2019-09-25 20:26:49 +03:00
commit a3305799c7
40 changed files with 959 additions and 286 deletions

View file

@ -224,6 +224,7 @@ export const parseStatus = (data) => {
output.statusnet_conversation_id = data.pleroma.conversation_id
output.is_local = pleroma.local
output.in_reply_to_screen_name = data.pleroma.in_reply_to_account_acct
output.thread_muted = pleroma.thread_muted
} else {
output.text = data.content
output.summary = data.spoiler_text

View file

@ -9,10 +9,7 @@ const fetchUser = (attempt, user, store) => new Promise((resolve, reject) => {
if (!following && !(locked && sent) && attempt <= 3) {
// If we BE reports that we still not following that user - retry,
// increment attempts by one
return fetchUser(++attempt, user, store)
} else {
// If we run out of attempts, just return whatever status is.
return sent
fetchUser(++attempt, user, store)
}
})
@ -23,7 +20,7 @@ export const requestFollow = (user, store) => new Promise((resolve, reject) => {
if (updated.following || (user.locked && user.requested)) {
// If we get result immediately or the account is locked, just stop.
resolve({ sent: updated.requested })
resolve()
return
}
@ -35,8 +32,8 @@ export const requestFollow = (user, store) => new Promise((resolve, reject) => {
// Recursive Promise, it will call itself up to 3 times.
return fetchUser(1, user, store)
.then((sent) => {
resolve({ sent })
.then(() => {
resolve()
})
})
})

View file

@ -10,6 +10,11 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => {
const args = { credentials }
const rootState = store.rootState || store.state
const timelineData = rootState.statuses.notifications
const hideMutedPosts = typeof rootState.config.hideMutedPosts === 'undefined'
? rootState.instance.hideMutedPosts
: rootState.config.hideMutedPosts
args['withMuted'] = !hideMutedPosts
args['timeline'] = 'notifications'
if (older) {

View file

@ -22,7 +22,7 @@ const setStyle = (href, commit) => {
***/
const head = document.head
const body = document.body
body.style.display = 'none'
body.classList.add('hidden')
const cssEl = document.createElement('link')
cssEl.setAttribute('rel', 'stylesheet')
cssEl.setAttribute('href', href)
@ -46,7 +46,7 @@ const setStyle = (href, commit) => {
head.appendChild(styleEl)
// const styleSheet = styleEl.sheet
body.style.display = 'initial'
body.classList.remove('hidden')
}
cssEl.addEventListener('load', setDynamic)
@ -75,7 +75,7 @@ const applyTheme = (input, commit) => {
const { rules, theme } = generatePreset(input)
const head = document.head
const body = document.body
body.style.display = 'none'
body.classList.add('hidden')
const styleEl = document.createElement('style')
head.appendChild(styleEl)
@ -86,7 +86,7 @@ const applyTheme = (input, commit) => {
styleSheet.insertRule(`body { ${rules.colors} }`, 'index-max')
styleSheet.insertRule(`body { ${rules.shadows} }`, 'index-max')
styleSheet.insertRule(`body { ${rules.fonts} }`, 'index-max')
body.style.display = 'initial'
body.classList.remove('hidden')
// commit('setOption', { name: 'colors', value: htmlColors })
// commit('setOption', { name: 'radii', value: radii })