* {
- flex: 1 0 0;
margin: 0 .75em .6em 0;
white-space: nowrap;
+ min-width: 95px;
}
button {
diff --git a/src/components/user_reporting_modal/user_reporting_modal.js b/src/components/user_reporting_modal/user_reporting_modal.js
index 7c6ea409..833fa98a 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.js
+++ b/src/components/user_reporting_modal/user_reporting_modal.js
@@ -2,12 +2,14 @@
import Status from '../status/status.vue'
import List from '../list/list.vue'
import Checkbox from '../checkbox/checkbox.vue'
+import Modal from '../modal/modal.vue'
const UserReportingModal = {
components: {
Status,
List,
- Checkbox
+ Checkbox,
+ Modal
},
data () {
return {
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index c79a3707..6ee53461 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -1,13 +1,9 @@
-
-
+
{{ $t('user_reporting.title', [user.screen_name]) }}
@@ -69,7 +65,7 @@
-
+
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index f12cccae..32eb802e 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -17,6 +17,7 @@ import Autosuggest from '../autosuggest/autosuggest.vue'
import Importer from '../importer/importer.vue'
import Exporter from '../exporter/exporter.vue'
import withSubscription from '../../hocs/with_subscription/with_subscription'
+import Checkbox from '../checkbox/checkbox.vue'
import Mfa from './mfa.vue'
const BlockList = withSubscription({
@@ -82,7 +83,8 @@ const UserSettings = {
ProgressButton,
Importer,
Exporter,
- Mfa
+ Mfa,
+ Checkbox
},
computed: {
user () {
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index ef75ac52..adf11907 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -53,12 +53,9 @@
/>
-
-
+
+ {{ $t('settings.lock_account_description') }}
+
@@ -75,69 +72,52 @@
-
-
+
+ {{ $t('settings.no_rich_text_description') }}
+
-
-
+
+ {{ $t('settings.hide_follows_description') }}
+
-
-
+ >
+ {{ $t('settings.hide_follows_count_description') }}
+
-
-
+ {{ $t('settings.hide_followers_description') }}
+
-
-
+ {{ $t('settings.hide_followers_count_description') }}
+
-
-
-
+
+
+ {{ $t('settings.show_admin_badge') }}
+
+
+ {{ $t('settings.show_moderator_badge') }}
+
+
-
-
+
+ {{ $t('settings.discoverable') }}
+
diff --git a/src/components/video_attachment/video_attachment.js b/src/components/video_attachment/video_attachment.js
index 76b19a02..f0ca7e89 100644
--- a/src/components/video_attachment/video_attachment.js
+++ b/src/components/video_attachment/video_attachment.js
@@ -3,7 +3,7 @@ const VideoAttachment = {
props: ['attachment', 'controls'],
data () {
return {
- loopVideo: this.$store.state.config.loopVideo
+ loopVideo: this.$store.getters.mergedConfig.loopVideo
}
},
methods: {
@@ -12,16 +12,16 @@ const VideoAttachment = {
if (typeof target.webkitAudioDecodedByteCount !== 'undefined') {
// non-zero if video has audio track
if (target.webkitAudioDecodedByteCount > 0) {
- this.loopVideo = this.loopVideo && !this.$store.state.config.loopVideoSilentOnly
+ this.loopVideo = this.loopVideo && !this.$store.getters.mergedConfig.loopVideoSilentOnly
}
} else if (typeof target.mozHasAudio !== 'undefined') {
// true if video has audio track
if (target.mozHasAudio) {
- this.loopVideo = this.loopVideo && !this.$store.state.config.loopVideoSilentOnly
+ this.loopVideo = this.loopVideo && !this.$store.getters.mergedConfig.loopVideoSilentOnly
}
} else if (typeof target.audioTracks !== 'undefined') {
if (target.audioTracks.length > 0) {
- this.loopVideo = this.loopVideo && !this.$store.state.config.loopVideoSilentOnly
+ this.loopVideo = this.loopVideo && !this.$store.getters.mergedConfig.loopVideoSilentOnly
}
}
}
diff --git a/src/directives/body_scroll_lock.js b/src/directives/body_scroll_lock.js
index 6ab20c3f..13a6de1c 100644
--- a/src/directives/body_scroll_lock.js
+++ b/src/directives/body_scroll_lock.js
@@ -2,42 +2,49 @@ import * as bodyScrollLock from 'body-scroll-lock'
let previousNavPaddingRight
let previousAppBgWrapperRight
+const lockerEls = new Set([])
const disableBodyScroll = (el) => {
const scrollBarGap = window.innerWidth - document.documentElement.clientWidth
bodyScrollLock.disableBodyScroll(el, {
reserveScrollBarGap: true
})
+ lockerEls.add(el)
setTimeout(() => {
- // If previousNavPaddingRight is already set, don't set it again.
- if (previousNavPaddingRight === undefined) {
- const navEl = document.getElementById('nav')
- previousNavPaddingRight = window.getComputedStyle(navEl).getPropertyValue('padding-right')
- navEl.style.paddingRight = previousNavPaddingRight ? `calc(${previousNavPaddingRight} + ${scrollBarGap}px)` : `${scrollBarGap}px`
+ if (lockerEls.size <= 1) {
+ // If previousNavPaddingRight is already set, don't set it again.
+ if (previousNavPaddingRight === undefined) {
+ const navEl = document.getElementById('nav')
+ previousNavPaddingRight = window.getComputedStyle(navEl).getPropertyValue('padding-right')
+ navEl.style.paddingRight = previousNavPaddingRight ? `calc(${previousNavPaddingRight} + ${scrollBarGap}px)` : `${scrollBarGap}px`
+ }
+ // If previousAppBgWrapeprRight is already set, don't set it again.
+ if (previousAppBgWrapperRight === undefined) {
+ const appBgWrapperEl = document.getElementById('app_bg_wrapper')
+ previousAppBgWrapperRight = window.getComputedStyle(appBgWrapperEl).getPropertyValue('right')
+ appBgWrapperEl.style.right = previousAppBgWrapperRight ? `calc(${previousAppBgWrapperRight} + ${scrollBarGap}px)` : `${scrollBarGap}px`
+ }
+ document.body.classList.add('scroll-locked')
}
- // If previousAppBgWrapeprRight is already set, don't set it again.
- if (previousAppBgWrapperRight === undefined) {
- const appBgWrapperEl = document.getElementById('app_bg_wrapper')
- previousAppBgWrapperRight = window.getComputedStyle(appBgWrapperEl).getPropertyValue('right')
- appBgWrapperEl.style.right = previousAppBgWrapperRight ? `calc(${previousAppBgWrapperRight} + ${scrollBarGap}px)` : `${scrollBarGap}px`
- }
- document.body.classList.add('scroll-locked')
})
}
const enableBodyScroll = (el) => {
+ lockerEls.delete(el)
setTimeout(() => {
- if (previousNavPaddingRight !== undefined) {
- document.getElementById('nav').style.paddingRight = previousNavPaddingRight
- // Restore previousNavPaddingRight to undefined so disableBodyScroll knows it can be set again.
- previousNavPaddingRight = undefined
+ if (lockerEls.size === 0) {
+ if (previousNavPaddingRight !== undefined) {
+ document.getElementById('nav').style.paddingRight = previousNavPaddingRight
+ // Restore previousNavPaddingRight to undefined so disableBodyScroll knows it can be set again.
+ previousNavPaddingRight = undefined
+ }
+ if (previousAppBgWrapperRight !== undefined) {
+ document.getElementById('app_bg_wrapper').style.right = previousAppBgWrapperRight
+ // Restore previousAppBgWrapperRight to undefined so disableBodyScroll knows it can be set again.
+ previousAppBgWrapperRight = undefined
+ }
+ document.body.classList.remove('scroll-locked')
}
- if (previousAppBgWrapperRight !== undefined) {
- document.getElementById('app_bg_wrapper').style.right = previousAppBgWrapperRight
- // Restore previousAppBgWrapperRight to undefined so disableBodyScroll knows it can be set again.
- previousAppBgWrapperRight = undefined
- }
- document.body.classList.remove('scroll-locked')
})
bodyScrollLock.enableBodyScroll(el)
}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 32c25e3e..d11b2d14 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -555,6 +555,8 @@
"unmute": "Unmute",
"unmute_progress": "Unmuting...",
"mute_progress": "Muting...",
+ "hide_repeats": "Hide repeats",
+ "show_repeats": "Show repeats",
"admin_menu": {
"moderation": "Moderation",
"grant_admin": "Grant Admin",
@@ -630,6 +632,8 @@
"return_home": "Return to the home page",
"not_found": "We couldn't find that email or username.",
"too_many_requests": "You have reached the limit of attempts, try again later.",
- "password_reset_disabled": "Password reset is disabled. Please contact your instance administrator."
+ "password_reset_disabled": "Password reset is disabled. Please contact your instance administrator.",
+ "password_reset_required": "You must reset your password to log in.",
+ "password_reset_required_but_mailer_is_disabled": "You must reset your password, but password reset is disabled. Please contact your instance administrator."
}
}
diff --git a/src/i18n/es.json b/src/i18n/es.json
index 53a3b9dd..163eb707 100644
--- a/src/i18n/es.json
+++ b/src/i18n/es.json
@@ -45,8 +45,8 @@
"error": "Se ha producido un error al importar el archivo."
},
"login": {
- "login": "Identificación",
- "description": "Identificación con OAuth",
+ "login": "Identificarse",
+ "description": "Identificarse con OAuth",
"logout": "Cerrar sesión",
"password": "Contraseña",
"placeholder": "p.ej. lain",
diff --git a/src/i18n/eu.json b/src/i18n/eu.json
index ad8f4c05..90bc13a4 100644
--- a/src/i18n/eu.json
+++ b/src/i18n/eu.json
@@ -68,6 +68,7 @@
},
"nav": {
"about": "Honi buruz",
+ "administration": "Administrazioa",
"back": "Atzera",
"chat": "Txat lokala",
"friend_requests": "Jarraitzeko eskaerak",
@@ -106,6 +107,15 @@
"expired": "Inkesta {0} bukatu zen",
"not_enough_options": "Aukera gutxiegi inkestan"
},
+ "emoji": {
+ "stickers": "Pegatinak",
+ "emoji": "Emoji",
+ "keep_open": "Mantendu hautatzailea zabalik",
+ "search_emoji": "Bilatu emoji bat",
+ "add_emoji": "Emoji bat gehitu",
+ "custom": "Ohiko emojiak",
+ "unicode": "Unicode emojiak"
+ },
"stickers": {
"add_sticker": "Pegatina gehitu"
},
@@ -199,12 +209,12 @@
"avatarRadius": "Avatarrak",
"background": "Atzeko planoa",
"bio": "Biografia",
- "block_export": "Bloke esportatzea",
- "block_export_button": "Esportatu zure blokeak csv fitxategi batera",
- "block_import": "Bloke inportazioa",
- "block_import_error": "Errorea blokeak inportatzen",
- "blocks_imported": "Blokeak inportaturik! Hauek prozesatzeak denbora hartuko du.",
- "blocks_tab": "Blokeak",
+ "block_export": "Blokeatu dituzunak esportatu",
+ "block_export_button": "Esportatu blokeatutakoak csv fitxategi batera",
+ "block_import": "Blokeatu dituzunak inportatu",
+ "block_import_error": "Errorea blokeatutakoak inportatzen",
+ "blocks_imported": "Blokeatutakoak inportaturik! Hauek prozesatzeak denbora hartuko du.",
+ "blocks_tab": "Blokeatutakoak",
"btnRadius": "Botoiak",
"cBlue": "Urdina (erantzun, jarraitu)",
"cGreen": "Berdea (Bertxiotu)",
@@ -222,7 +232,9 @@
"data_import_export_tab": "Datuak Inportatu / Esportatu",
"default_vis": "Lehenetsitako ikusgaitasunak",
"delete_account": "Ezabatu kontua",
+ "discoverable": "Baimendu zure kontua kanpo bilaketa-emaitzetan eta bestelako zerbitzuetan agertzea",
"delete_account_description": "Betirako ezabatu zure kontua eta zure mezu guztiak",
+ "pad_emoji": "Zuriuneak gehitu emoji bat aukeratzen denean",
"delete_account_error": "Arazo bat gertatu da zure kontua ezabatzerakoan. Arazoa jarraitu eskero, administratzailearekin harremanetan jarri.",
"delete_account_instructions": "Idatzi zure pasahitza kontua ezabatzeko.",
"avatar_size_instruction": "Avatar irudien gomendatutako gutxieneko tamaina 150x150 pixel dira.",
@@ -254,7 +266,7 @@
"instance_default": "(lehenetsia: {value})",
"instance_default_simple": "(lehenetsia)",
"interface": "Interfazea",
- "interfaceLanguage": "Interfaze hizkuntza",
+ "interfaceLanguage": "Interfazearen hizkuntza",
"invalid_theme_imported": "Hautatutako fitxategia ez da onartutako Pleroma gaia. Ez da zure gaian aldaketarik burutu.",
"limited_availability": "Ez dago erabilgarri zure nabigatzailean",
"links": "Estekak",
@@ -277,6 +289,8 @@
"no_mutes": "Ez daude erabiltzaile mututuak",
"hide_follows_description": "Ez erakutsi nor jarraitzen ari naizen",
"hide_followers_description": "Ez erakutsi nor ari den ni jarraitzen",
+ "hide_follows_count_description": "Ez erakutsi jarraitzen ari naizen kontuen kopurua",
+ "hide_followers_count_description": "Ez erakutsi nire jarraitzaileen kontuen kopurua",
"show_admin_badge": "Erakutsi Administratzaile etiketa nire profilan",
"show_moderator_badge": "Erakutsi Moderatzaile etiketa nire profilan",
"nsfw_clickthrough": "Gaitu klika hunkigarri eranskinak ezkutatzeko",
@@ -449,7 +463,7 @@
},
"version": {
"title": "Bertsioa",
- "backend_version": "Backend Bertsio",
+ "backend_version": "Backend Bertsioa",
"frontend_version": "Frontend Bertsioa"
}
},
@@ -529,6 +543,7 @@
"follows_you": "Jarraitzen dizu!",
"its_you": "Zu zara!",
"media": "Multimedia",
+ "mention": "Aipatu",
"mute": "Isilarazi",
"muted": "Isilduta",
"per_day": "eguneko",
diff --git a/src/main.js b/src/main.js
index 7923ffe8..a9db1cff 100644
--- a/src/main.js
+++ b/src/main.js
@@ -41,7 +41,13 @@ Vue.use(VueChatScroll)
Vue.use(VueClickOutside)
Vue.use(PortalVue)
Vue.use(VBodyScrollLock)
-Vue.use(VTooltip)
+Vue.use(VTooltip, {
+ popover: {
+ defaultTrigger: 'hover click',
+ defaultContainer: false,
+ defaultOffset: 5
+ }
+})
const i18n = new VueI18n({
// By default, use the browser locale, we will update it if neccessary
diff --git a/src/modules/config.js b/src/modules/config.js
index cf04d14f..78314118 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -3,8 +3,9 @@ import { setPreset, applyTheme } from '../services/style_setter/style_setter.js'
const browserLocale = (window.navigator.language || 'en').split('-')[0]
-const defaultState = {
+export const defaultState = {
colors: {},
+ // bad name: actually hides posts of muted USERS
hideMutedPosts: undefined, // instance default
collapseMessageWithSubject: undefined, // instance default
padEmoji: true,
@@ -37,11 +38,37 @@ const defaultState = {
subjectLineBehavior: undefined, // instance default
alwaysShowSubjectInput: undefined, // instance default
postContentType: undefined, // instance default
- minimalScopesMode: undefined // instance default
+ minimalScopesMode: undefined, // instance default
+ // This hides statuses filtered via a word filter
+ hideFilteredStatuses: undefined, // instance default
+ playVideosInModal: false,
+ useOneClickNsfw: false,
+ useContainFit: false,
+ hidePostStats: undefined, // instance default
+ hideUserStats: undefined // instance default
}
+// caching the instance default properties
+export const instanceDefaultProperties = Object.entries(defaultState)
+ .filter(([key, value]) => value === undefined)
+ .map(([key, value]) => key)
+
const config = {
state: defaultState,
+ getters: {
+ mergedConfig (state, getters, rootState, rootGetters) {
+ const { instance } = rootState
+ return {
+ ...state,
+ ...instanceDefaultProperties
+ .map(key => [key, state[key] === undefined
+ ? instance[key]
+ : state[key]
+ ])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
+ }
+ }
+ },
mutations: {
setOption (state, { name, value }) {
set(state, name, value)
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 7d602aa1..0c1235ca 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -1,5 +1,6 @@
import { set } from 'vue'
import { setPreset } from '../services/style_setter/style_setter.js'
+import { instanceDefaultProperties } from './config.js'
const defaultState = {
// Stuff from static/config.json and apiConfig
@@ -72,6 +73,13 @@ const instance = {
}
}
},
+ getters: {
+ instanceDefaultConfig (state) {
+ return instanceDefaultProperties
+ .map(key => [key, state[key]])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
+ }
+ },
actions: {
setInstanceOption ({ commit, dispatch }, { name, value }) {
commit('setInstanceOption', { name, value })
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 918065d2..f11ffdcd 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -537,6 +537,10 @@ const statuses = {
setNotificationsSilence ({ rootState, commit }, { value }) {
commit('setNotificationsSilence', { value })
},
+ fetchStatus ({ rootState, dispatch }, id) {
+ rootState.api.backendInteractor.fetchStatus({ id })
+ .then((status) => dispatch('addNewStatuses', { statuses: [status] }))
+ },
deleteStatus ({ rootState, commit }, status) {
commit('setDeleted', { status })
apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials })
diff --git a/src/modules/users.js b/src/modules/users.js
index 4d02f8d7..6d259dc2 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -60,6 +60,18 @@ const unmuteUser = (store, id) => {
.then((relationship) => store.commit('updateUserRelationship', [relationship]))
}
+const hideReblogs = (store, userId) => {
+ return store.rootState.api.backendInteractor.followUser({ id: userId, reblogs: false })
+ .then((relationship) => {
+ store.commit('updateUserRelationship', [relationship])
+ })
+}
+
+const showReblogs = (store, userId) => {
+ return store.rootState.api.backendInteractor.followUser({ id: userId, reblogs: true })
+ .then((relationship) => store.commit('updateUserRelationship', [relationship]))
+}
+
export const mutations = {
setMuted (state, { user: { id }, muted }) {
const user = state.usersObject[id]
@@ -135,6 +147,7 @@ export const mutations = {
user.muted = relationship.muting
user.statusnet_blocking = relationship.blocking
user.subscribed = relationship.subscribing
+ user.showing_reblogs = relationship.showing_reblogs
}
})
},
@@ -272,6 +285,12 @@ const users = {
unmuteUser (store, id) {
return unmuteUser(store, id)
},
+ hideReblogs (store, id) {
+ return hideReblogs(store, id)
+ },
+ showReblogs (store, id) {
+ return showReblogs(store, id)
+ },
muteUsers (store, ids = []) {
return Promise.all(ids.map(id => muteUser(store, id)))
},
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 887d7d7a..61cd4f16 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -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())
}
diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js
index 3c44a10c..cbf48ee4 100644
--- a/src/services/backend_interactor_service/backend_interactor_service.js
+++ b/src/services/backend_interactor_service/backend_interactor_service.js
@@ -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) => {
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index 67664af8..5f45660d 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -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
}
diff --git a/src/services/follow_manipulate/follow_manipulate.js b/src/services/follow_manipulate/follow_manipulate.js
index d82ce593..598cb5f7 100644
--- a/src/services/follow_manipulate/follow_manipulate.js
+++ b/src/services/follow_manipulate/follow_manipulate.js
@@ -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])
diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js
index b6c4cf80..47008026 100644
--- a/src/services/notifications_fetcher/notifications_fetcher.service.js
+++ b/src/services/notifications_fetcher/notifications_fetcher.service.js
@@ -8,11 +8,10 @@ const update = ({ store, notifications, older }) => {
const fetchAndUpdate = ({ store, credentials, older = false }) => {
const args = { credentials }
+ const { getters } = store
const rootState = store.rootState || store.state
const timelineData = rootState.statuses.notifications
- const hideMutedPosts = typeof rootState.config.hideMutedPosts === 'undefined'
- ? rootState.instance.hideMutedPosts
- : rootState.config.hideMutedPosts
+ const hideMutedPosts = getters.mergedConfig.hideMutedPosts
args['withMuted'] = !hideMutedPosts
diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js
index f72688f8..9eb30c2d 100644
--- a/src/services/timeline_fetcher/timeline_fetcher.service.js
+++ b/src/services/timeline_fetcher/timeline_fetcher.service.js
@@ -15,13 +15,21 @@ const update = ({ store, statuses, timeline, showImmediately, userId }) => {
})
}
-const fetchAndUpdate = ({ store, credentials, timeline = 'friends', older = false, showImmediately = false, userId = false, tag = false, until }) => {
+const fetchAndUpdate = ({
+ store,
+ credentials,
+ timeline = 'friends',
+ older = false,
+ showImmediately = false,
+ userId = false,
+ tag = false,
+ until
+}) => {
const args = { timeline, credentials }
const rootState = store.rootState || store.state
+ const { getters } = store
const timelineData = rootState.statuses.timelines[camelCase(timeline)]
- const hideMutedPosts = typeof rootState.config.hideMutedPosts === 'undefined'
- ? rootState.instance.hideMutedPosts
- : rootState.config.hideMutedPosts
+ const hideMutedPosts = getters.mergedConfig.hideMutedPosts
if (older) {
args['until'] = until || timelineData.minId
diff --git a/test/unit/specs/components/emoji_input.spec.js b/test/unit/specs/components/emoji_input.spec.js
index 368d623d..b1b98802 100644
--- a/test/unit/specs/components/emoji_input.spec.js
+++ b/test/unit/specs/components/emoji_input.spec.js
@@ -12,8 +12,8 @@ const generateInput = (value, padEmoji = true) => {
},
mocks: {
$store: {
- state: {
- config: {
+ getters: {
+ mergedConfig: {
padEmoji
}
}
diff --git a/test/unit/specs/components/user_profile.spec.js b/test/unit/specs/components/user_profile.spec.js
index 6de9491a..1b6a47d7 100644
--- a/test/unit/specs/components/user_profile.spec.js
+++ b/test/unit/specs/components/user_profile.spec.js
@@ -18,7 +18,14 @@ const actions = {
}
const testGetters = {
- findUser: state => getters.findUser(state.users)
+ findUser: state => getters.findUser(state.users),
+ mergedConfig: state => ({
+ colors: '',
+ highlight: {},
+ customTheme: {
+ colors: []
+ }
+ })
}
const localUser = {
@@ -45,13 +52,6 @@ const externalProfileStore = new Vuex.Store({
interface: {
browserSupport: ''
},
- config: {
- colors: '',
- highlight: {},
- customTheme: {
- colors: []
- }
- },
instance: {
hideUserStats: true
},