diff --git a/app/soapbox/actions/importer/normalizer.js b/app/soapbox/actions/importer/normalizer.js index a294f4680..d61932957 100644 --- a/app/soapbox/actions/importer/normalizer.js +++ b/app/soapbox/actions/importer/normalizer.js @@ -40,13 +40,3 @@ export function normalizeAccount(account) { return account; } - -export function normalizeChat(chat, normalOldChat) { - const normalChat = { ...chat }; - const { account, last_message: lastMessage } = chat; - - if (account) normalChat.account = account.id; - if (lastMessage) normalChat.last_message = lastMessage.id; - - return normalChat; -} diff --git a/app/soapbox/reducers/chats.js b/app/soapbox/reducers/chats.js index 85447adc0..430251210 100644 --- a/app/soapbox/reducers/chats.js +++ b/app/soapbox/reducers/chats.js @@ -9,9 +9,18 @@ import { CHAT_READ_SUCCESS, CHAT_READ_REQUEST, } from 'soapbox/actions/chats'; -import { normalizeChat } from 'soapbox/actions/importer/normalizer'; import { STREAMING_CHAT_UPDATE } from 'soapbox/actions/streaming'; +const normalizeChat = (chat, normalOldChat) => { + const normalChat = { ...chat }; + const { account, last_message: lastMessage } = chat; + + if (account) normalChat.account = account.id; + if (lastMessage) normalChat.last_message = lastMessage.id; + + return normalChat; +}; + const importChat = (state, chat) => state.setIn(['items', chat.id], fromJS(normalizeChat(chat))); const importChats = (state, chats, next) =>