Skip to content

Commit

Permalink
Fix toast at wrong location
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabau committed Nov 13, 2023
1 parent ddc9e82 commit d7142f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/hooks/useMatchUsers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useSession } from "next-auth/react";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import toast from "react-hot-toast";
import { api } from "~/utils/api";

type UseMatchUsersResult = {
Expand All @@ -23,6 +24,7 @@ export default function useMatchUsers(): UseMatchUsersResult {
data.user2 === session?.user.id
) {
console.log("Routing");
toast.success("Redirecting to room...");
void router.push(`/collab/rooms/${data.sessionId}`);
}
},
Expand Down
1 change: 0 additions & 1 deletion src/pages/collab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ const MatchRequestPage = () => {
api.matchRequest.subscribeToMyRequestSuccess.useSubscription(undefined, {
onData(data) {
matchUsers.setMatchedUsers(data.userId1, data.userId2);
toast.success("Redirecting to room...");
},
});
// subscprtions api -- END
Expand Down

0 comments on commit d7142f6

Please sign in to comment.