Skip to content

Commit

Permalink
added db name
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaBhattacharjee committed Jan 13, 2024
1 parent 7ac264c commit 615b77d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/CommentSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const CommentSection = ({ streamId }: Props) => {
>
{commentData.map((comment: comment) => (
<div className="flex gap-4" key={comment?._id}>
{userData[comment.userId]?.profilePicture === "" ? <div className="h-12 w-12 rounded-full font-semibold justify-center flex items-center">{userData[comment.userId]?.username[0]?.toUpperCase()}</div> : <img src={userData[comment?.userId]?.profilePicture} className="h-12 w-12 rounded-full font-semibold justify-center flex items-center" />}
{userData[comment.userId]?.profilePicture === "" ? <div className="h-12 w-12 bg-white text-black font-bold text-lg rounded-full justify-center flex items-center">{userData[comment.userId]?.username[0]?.toUpperCase()}</div> : <img src={userData[comment?.userId]?.profilePicture} className="h-12 w-12 rounded-full font-semibold justify-center flex items-center" />}
<div className="flex flex-col">
<div className="flex w-full items-center">
<div className="flex gap-3 items-center">
Expand Down
4 changes: 3 additions & 1 deletion src/database/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import mongoose from "mongoose";

export async function connect() {
try {
await mongoose.connect(process.env.NEXT_PUBLIC_MONGODB_URI || "mongodb://localhost:27017");
await mongoose.connect(process.env.NEXT_PUBLIC_MONGODB_URI || "mongodb://localhost:27017", {
dbName: "Animetrix",
});
const connection = mongoose.connection;

connection.on("connected", () => {
Expand Down

0 comments on commit 615b77d

Please sign in to comment.