diff --git a/src/lang/en.js b/src/lang/en.js index 7512ecbf..8b8e9ff7 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -244,7 +244,9 @@ export default { statuses: 'Statuses by instance', instanceFilter: 'Instance filter', loadMore: 'Load more', - noInstances: 'No other instances found' + noInstances: 'No other instances found', + onlyLocalStatuses: 'Show only local statuses', + showPrivateStatuses: 'Show private statuses' }, userProfile: { tags: 'Tags', @@ -255,7 +257,6 @@ export default { localUppercase: 'Local', nickname: 'Nickname', recentStatuses: 'Recent Statuses', - showPrivateStatuses: 'Show private statuses', roles: 'Roles', activeUppercase: 'Active', active: 'active', diff --git a/src/store/modules/status.js b/src/store/modules/status.js index 0760f87d..281e4524 100644 --- a/src/store/modules/status.js +++ b/src/store/modules/status.js @@ -6,11 +6,19 @@ const status = { loading: false, statusesByInstance: { selectedInstance: '', + showLocal: false, + showPrivate: false, page: 1, pageSize: 30 } }, mutations: { + CHANGE_GODMODE_CHECKBOX_VALUE: (state, value) => { + state.statusesByInstance.showPrivate = value + }, + CHANGE_LOCAL_CHECKBOX_VALUE: (state, value) => { + state.statusesByInstance.showLocal = value + }, CHANGE_PAGE: (state, page) => { state.statusesByInstance.page = page }, @@ -48,12 +56,6 @@ const status = { dispatch('FetchStatusesByInstance') } }, - async FetchStatuses({ commit, getters }, { godmode, localOnly }) { - commit('SET_LOADING', true) - const statuses = await fetchStatuses({ godmode, localOnly, authHost: getters.authHost, token: getters.token }) - commit('SET_STATUSES_BY_INSTANCE', statuses.data) - commit('SET_LOADING', false) - }, async FetchStatusesByInstance({ commit, getters, state, rootState }) { commit('SET_LOADING', true) if (state.statusesByInstance.selectedInstance === '') { @@ -62,8 +64,8 @@ const status = { const statuses = state.statusesByInstance.selectedInstance === rootState.user.authHost ? await fetchStatuses( { - godmode: false, - localOnly: false, + godmode: state.statusesByInstance.showPrivate, + localOnly: state.statusesByInstance.showLocal, authHost: getters.authHost, token: getters.token }) @@ -93,6 +95,14 @@ const status = { commit('PUSH_STATUSES', statuses.data) commit('SET_LOADING', false) }, + HandleGodmodeCheckboxChange({ commit, dispatch }, value) { + commit('CHANGE_GODMODE_CHECKBOX_VALUE', value) + dispatch('FetchStatusesByInstance') + }, + HandleLocalCheckboxChange({ commit, dispatch }, value) { + commit('CHANGE_LOCAL_CHECKBOX_VALUE', value) + dispatch('FetchStatusesByInstance') + }, HandleFilterChange({ commit }, instance) { commit('CHANGE_SELECTED_INSTANCE', instance) }, diff --git a/src/views/statuses/index.vue b/src/views/statuses/index.vue index fe9d9345..1c17eaa5 100644 --- a/src/views/statuses/index.vue +++ b/src/views/statuses/index.vue @@ -22,6 +22,14 @@ :selected-users="selectedUsers" @apply-action="clearSelection"/> +
{{ $t('userProfile.noStatuses') }}