diff options
| author | Henry Jameson <me@hjkos.com> | 2019-09-25 20:26:49 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-09-25 20:26:49 +0300 |
| commit | a3305799c7ee9292550346006cf0389bed963e2c (patch) | |
| tree | cd6a5dc550e35d9c450a349c074366b72892a6fe /src/services | |
| parent | 2f26e8acc5395753f4d649d9a1bfbe356717e9ac (diff) | |
| parent | e55645aec16f083e4eedf6b01954b79689c244f1 (diff) | |
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
...
Diffstat (limited to 'src/services')
4 files changed, 14 insertions, 11 deletions
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 6cc1851d..7438cd90 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -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 diff --git a/src/services/follow_manipulate/follow_manipulate.js b/src/services/follow_manipulate/follow_manipulate.js index 529fdb9b..d82ce593 100644 --- a/src/services/follow_manipulate/follow_manipulate.js +++ b/src/services/follow_manipulate/follow_manipulate.js @@ -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() }) }) }) diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index f9ec3f6e..b6c4cf80 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -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) { diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index f186d202..1cf7edc3 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -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 }) |
