feat: remove usage of .last
This commit is contained in:
@@ -181,7 +181,7 @@ const actions = {
|
||||
);
|
||||
if (!selectedChat) return;
|
||||
const { messages } = selectedChat;
|
||||
const lastMessage = messages.last();
|
||||
const lastMessage = messages[messages.length - 1];
|
||||
if (!lastMessage) return;
|
||||
commit(types.SET_LAST_MESSAGE_ID_IN_SYNC_CONVERSATION, {
|
||||
conversationId,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import commonHelpers from '../../../../helper/commons';
|
||||
import getters from '../../conversations/getters';
|
||||
/*
|
||||
Order of conversations in the fixture is as follows:
|
||||
@@ -9,9 +8,6 @@ import getters from '../../conversations/getters';
|
||||
*/
|
||||
import conversations from './conversations.fixtures';
|
||||
|
||||
// loads .last() helper
|
||||
commonHelpers();
|
||||
|
||||
describe('#getters', () => {
|
||||
describe('#getAllConversations', () => {
|
||||
it('returns conversations ordered by lastActivityAt in descending order if no sort order is available', () => {
|
||||
|
||||
Reference in New Issue
Block a user