updated
This commit is contained in:
@@ -11,7 +11,7 @@ import { signInApi } from "../services/factoryBuilder/signInSignUp/signInApi";
|
||||
import { signUpApi } from "../services/factoryBuilder/signInSignUp/signUpApi";
|
||||
import FingerprintJS from "@fingerprintjs/fingerprintjs";
|
||||
import { recentlyViewed } from "../services/dashboard/recentlyViewed";
|
||||
import { getUserData } from "../components/Dashboard/functions/getUserData";
|
||||
import { getUserData } from "../functions/getUserData";
|
||||
|
||||
const UserAuth: React.FC = () => {
|
||||
const [email, setEmail] = useState("");
|
||||
@@ -56,16 +56,16 @@ const UserAuth: React.FC = () => {
|
||||
localStorage.setItem("refreshToken", res.message.refreshToken);
|
||||
|
||||
try {
|
||||
// console.log('res.message.userId: ', res.message.userId);
|
||||
// console.log('organization: ', organization);
|
||||
const projects = await recentlyViewed(organization, res.message.userId);
|
||||
// console.log('projects: ', projects);
|
||||
|
||||
if (res.message.isShare) {
|
||||
if (Object.values(projects.RecentlyViewed).length > 0) {
|
||||
const firstId = (Object.values(projects?.RecentlyViewed || {})[0] as any)?._id;
|
||||
setLoadingProgress(1)
|
||||
navigate(`/${firstId}`)
|
||||
if (Object.values(projects?.RecentlyViewed).filter((val: any) => val._id == firstId)) {
|
||||
setLoadingProgress(1)
|
||||
navigate(`/${firstId}`)
|
||||
} else {
|
||||
navigate("/Dashboard")
|
||||
}
|
||||
} else {
|
||||
setLoadingProgress(1);
|
||||
navigate("/Dashboard");
|
||||
|
||||
Reference in New Issue
Block a user