From c615902cee0f4c9371b1e3dd12a4bfdb7cbc7c08 Mon Sep 17 00:00:00 2001 From: MK Fain Date: Sun, 27 Sep 2020 16:41:01 +0000 Subject: [PATCH] Apply 6 suggestion(s) to 3 file(s) --- src/api/chat.js | 6 ++++-- src/store/modules/chat.js | 6 +++--- src/views/users/show.vue | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/api/chat.js b/src/api/chat.js index e7c1d184..3e483ea4 100644 --- a/src/api/chat.js +++ b/src/api/chat.js @@ -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) }) diff --git a/src/store/modules/chat.js b/src/store/modules/chat.js index ca288743..cc4debbe 100644 --- a/src/store/modules/chat.js +++ b/src/store/modules/chat.js @@ -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) }, diff --git a/src/views/users/show.vue b/src/views/users/show.vue index f2d0662c..096ff50d 100644 --- a/src/views/users/show.vue +++ b/src/views/users/show.vue @@ -372,6 +372,7 @@ table { .user-chats-card { width: auto; height: fit-content; + margin-bottom: 20px; } .user-profile-container { display: flex;