Bugs fixed
parent
292037c4fc
commit
fb6f587981
|
|
@ -114,7 +114,12 @@ export default function Landing() {
|
||||||
"
|
"
|
||||||
key={index}
|
key={index}
|
||||||
href={item.link}
|
href={item.link}
|
||||||
onClick={() => localStorage.removeItem("Sootzani_Login_State")}
|
onClick={() => {
|
||||||
|
localStorage.removeItem("Sootzani_Login_State");
|
||||||
|
if (index == 0) {
|
||||||
|
localStorage.setItem("unknown", "true");
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<p className="text-xs text-center font-medium text-gray hidden group-hover:flex ">
|
<p className="text-xs text-center font-medium text-gray hidden group-hover:flex ">
|
||||||
{item.description}
|
{item.description}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ export default function ProfileDropDown() {
|
||||||
return (
|
return (
|
||||||
<DropdownMenu dir="rtl">
|
<DropdownMenu dir="rtl">
|
||||||
<DropdownMenuTrigger className=" max-sm:-mr-8 max-sm:text-xs" asChild>
|
<DropdownMenuTrigger className=" max-sm:-mr-8 max-sm:text-xs" asChild>
|
||||||
<Button variant="outline">{profileData?.userName}</Button>
|
<Button variant="outline">
|
||||||
|
{profileData?.title ? profileData.title : profileData.userName}
|
||||||
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent className="w-56 sm:ml-10">
|
<DropdownMenuContent className="w-56 sm:ml-10">
|
||||||
<DropdownMenuGroup>
|
<DropdownMenuGroup>
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ import { ThreeDots } from "react-loader-spinner";
|
||||||
import useToken from "@/store/useToken";
|
import useToken from "@/store/useToken";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { RefreshCcw } from "lucide-react";
|
import { RefreshCcw } from "lucide-react";
|
||||||
|
import { getCookie } from "cookies-next";
|
||||||
|
|
||||||
const MAX_IMAGE_SIZE = 5242880; // 5 MB
|
const MAX_IMAGE_SIZE = 5242880; // 5 MB
|
||||||
const ALLOWED_IMAGE_TYPES = [
|
const ALLOWED_IMAGE_TYPES = [
|
||||||
|
|
@ -117,9 +118,11 @@ export default function RequestStep2() {
|
||||||
localStorage.setItem("password", res.password);
|
localStorage.setItem("password", res.password);
|
||||||
router.push("/RequestResult");
|
router.push("/RequestResult");
|
||||||
},
|
},
|
||||||
onError: (error) => { toast("مشکلی در ارسال درخواست به وجود آمد.", {
|
onError: (error) => {
|
||||||
|
toast("مشکلی در ارسال درخواست به وجود آمد.", {
|
||||||
className: "!bg-red-500 !text-white",
|
className: "!bg-red-500 !text-white",
|
||||||
});},
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const authorizedComplaintSubmitMutation = useMutation({
|
const authorizedComplaintSubmitMutation = useMutation({
|
||||||
|
|
@ -190,7 +193,9 @@ export default function RequestStep2() {
|
||||||
formData.append("Captcha.Key", CaptchaData?.headers["captcha-key"]);
|
formData.append("Captcha.Key", CaptchaData?.headers["captcha-key"]);
|
||||||
formData.append("Complaining", data.person ? data.person : "");
|
formData.append("Complaining", data.person ? data.person : "");
|
||||||
formData.append("OrganizationId", data.OrganizationId);
|
formData.append("OrganizationId", data.OrganizationId);
|
||||||
if (isAuth) {
|
const unknown = localStorage.getItem("unknown");
|
||||||
|
const isAuth = getCookie("Sootzani_Token");
|
||||||
|
if (isAuth && !unknown) {
|
||||||
authorizedComplaintSubmitMutation.mutate({
|
authorizedComplaintSubmitMutation.mutate({
|
||||||
Data: formData,
|
Data: formData,
|
||||||
});
|
});
|
||||||
|
|
@ -199,6 +204,7 @@ export default function RequestStep2() {
|
||||||
Data: formData,
|
Data: formData,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
refetch();
|
refetch();
|
||||||
resetField("Title");
|
resetField("Title");
|
||||||
resetField("Text");
|
resetField("Text");
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^3.3.2",
|
"@hookform/resolvers": "^3.3.2",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue