Skip to content

Commit

Permalink
removed lodash usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigran-Harutyunyan committed Feb 15, 2024
1 parent c3127bc commit 7668ff7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions components/conversation/Body.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script setup lang="ts">
import { type FullMessageType } from "@/types";
import { find } from "lodash";
import MessageBox from "@/components/conversation/MessageBox.vue";
import { useConversation } from "@/composables/useConversation";
Expand All @@ -27,8 +26,7 @@ const setSeen = async () => {
const messageHandler = (message: FullMessageType) => {
setSeen();
if (!find(messages.value, { id: message.id })) {
if (!messages.value.find((item) => item.id === message.id)) {
messages.value.push(message);
}
Expand Down
3 changes: 1 addition & 2 deletions components/conversations/ConversationList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script setup lang="ts">
import clsx from "clsx";
import { type FullConversationType } from "../../types";
import { find } from "lodash";
import ConversationBox from "./ConversationBox.vue";
import useConversation from "@/composables/useConversation";
Expand Down Expand Up @@ -38,7 +37,7 @@ const updateHandler = (conversation: FullConversationType) => {
};
const newHandler = (conversation: FullConversationType) => {
if (!find(items.value, { id: conversation.id })) {
if (!items.value.find((item) => item.id === conversation.id)) {
items.value.push(conversation);
}
};
Expand Down

0 comments on commit 7668ff7

Please sign in to comment.