Apply 6 suggestion(s) to 3 file(s)

This commit is contained in:
MK Fain 2020-09-27 16:41:01 +00:00 committed by Angelina Filippova
parent 9629862d56
commit c615902cee
3 changed files with 8 additions and 5 deletions

View file

@ -22,10 +22,12 @@ export async function fetchChat(id, authHost, token) {
export async function fetchChatMessages(id, max_id, authHost, token) {
let url
max_id !== null ? url = `/api/pleroma/admin/chats/${id}/messages?max_id=${max_id}` : url = `/api/pleroma/admin/chats/${id}/messages`
const url = max_id
? `/api/pleroma/admin/chats/${id}/messages?max_id=${max_id}`
: `/api/pleroma/admin/chats/${id}/messages`
return await request({
baseURL: baseName(authHost),
url: url,
url,
method: 'get',
headers: authHeaders(token)
})

View file

@ -7,7 +7,7 @@ const chat = {
loading: false,
buttonLoading: false,
allLoaded: false,
max_id: null
maxId: null
},
mutations: {
SET_LOADING: (state, chat) => {
@ -26,7 +26,7 @@ const chat = {
state.fetchedChatMessages = chatMessages
},
CHANGE_MAX_ID: (state, max_id) => {
state.max_id = max_id
state.maxId = max_id
}
},
actions: {
@ -39,7 +39,7 @@ const chat = {
},
async FetchChatMessages({ commit, dispatch, getters, state }, id, max_id) {
commit('SET_LOADING', true)
const chat = await fetchChatMessages(id, state.max_id, getters.authHost, getters.token)
const chat = await fetchChatMessages(id, state.maxId, getters.authHost, getters.token)
commit('SET_CHAT_MESSAGES', chat.data)
commit('SET_LOADING', false)
},

View file

@ -372,6 +372,7 @@ table {
.user-chats-card {
width: auto;
height: fit-content;
margin-bottom: 20px;
}
.user-profile-container {
display: flex;