Report logic #2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
import { ExclamationTriangleIcon, PaperPlaneIcon } from "@radix-ui/react-icons";
|
||||
import { useReportStore } from "_store/reportStore";
|
||||
import { useReportStore, sendReport } from "_store/reportStore";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
@@ -107,13 +107,14 @@ export const Report = () => {
|
||||
e.preventDefault();
|
||||
if (message.length < 1 || !selectedPlayer) return;
|
||||
setSending(true);
|
||||
// TODO: Implement logic for reports
|
||||
/* sendReport(selectedPlayer, message).then(() => {
|
||||
setMessage("");
|
||||
setSending(false);
|
||||
}); */
|
||||
setMessage("");
|
||||
setSending(false);
|
||||
sendReport(selectedPlayer, message)
|
||||
.then(() => {
|
||||
setMessage("");
|
||||
setSending(false);
|
||||
})
|
||||
.catch(() => {
|
||||
setSending(false);
|
||||
});
|
||||
}}
|
||||
disabled={sending}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user