Skip to content

Commit

Permalink
added a guard
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigran-Harutyunyan committed Feb 15, 2024
1 parent 522de51 commit 095fd5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/modals/GroupChatModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const name = ref();
const members = ref([]);
const options = computed(() => {
if (!users) return [];
return users.map((user) => ({
value: user.id,
label: user.name,
Expand Down
1 change: 1 addition & 0 deletions composables/useOtherUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { type User } from "@prisma/client";
export const useOtherUser = (conversation: FullConversationType | { users: User[] }, session: any) => {

const otherUser = computed(() => {
if (!conversation) return null;
const currentUserEmail = session?.value?.user?.email;

const otherUser = conversation.users.filter((user) => user.email !== currentUserEmail);
Expand Down

0 comments on commit 095fd5d

Please sign in to comment.