Skip to content

Commit

Permalink
refactor(functions): 🔥 remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nstringham committed Nov 9, 2022
1 parent 75e99e0 commit 815656a
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions client/src/lib/firebase/chat.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
import { query, where, getDocs, addDoc, serverTimestamp } from "firebase/firestore";
import { getChatRoomCollection, getChatRoomMessagesCollection } from "./firestore-collections";
import { addDoc, serverTimestamp } from "firebase/firestore";
import { getChatRoomMessagesCollection } from "./firestore-collections";
import { chatMessageValidator } from "./firestore-types/lobby";

/**
* Checks if the user is in a chatroom then returns their chatroom doc
*/
export async function findChatRoom(lobbyId: string, playerId: string) {
const queryChatRoom = await getDocs(query(getChatRoomCollection(lobbyId), where("pair", "array-contains", playerId)));
return queryChatRoom.docs[0];
}

export async function findViewerChatRoom(lobbyId: string, viewerId: string) {
const queryChatRoom = await getDocs(
query(getChatRoomCollection(lobbyId), where("viewers", "array-contains", viewerId))
);
return queryChatRoom.docs[0];
}
/**
* Adds Message for the user to the chatroom
*/
Expand Down

0 comments on commit 815656a

Please sign in to comment.