update assetID
This commit is contained in:
@@ -8,11 +8,20 @@ import DashboardTrash from "../components/Dashboard/DashboardTrash";
|
||||
import { getUserData } from "../components/Dashboard/functions/getUserData";
|
||||
import SidePannel from "../components/Dashboard/SidePannel";
|
||||
import DashboardTutorial from "../components/Dashboard/DashboardTutorial";
|
||||
import { useProductStore } from "../store/simulation/useProductStore";
|
||||
import { useEventsStore } from "../store/simulation/useEventsStore";
|
||||
|
||||
const Dashboard: React.FC = () => {
|
||||
const [activeTab, setActiveTab] = useState<string>("Home");
|
||||
const { socket } = useSocketStore();
|
||||
const { userId, organization, email, userName } = getUserData();
|
||||
const { clearProducts } = useProductStore();
|
||||
const { clearEvents } = useEventsStore();
|
||||
|
||||
useEffect(() => {
|
||||
clearEvents();
|
||||
clearProducts();
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
const token = localStorage.getItem("token");
|
||||
|
||||
@@ -61,14 +61,13 @@ const UserAuth: React.FC = () => {
|
||||
const projects = await recentlyViewed(organization, res.message.userId);
|
||||
console.log('projects: ', projects);
|
||||
|
||||
if (Object.values(projects.RecentlyViewed).length > 0) {
|
||||
const firstId = (Object.values(projects?.RecentlyViewed || {})[0] as any)?._id;
|
||||
setLoadingProgress(1)
|
||||
navigate(`/${firstId}`)
|
||||
} else {
|
||||
if (res.message.isShare) {
|
||||
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}`)
|
||||
} else {
|
||||
setLoadingProgress(1);
|
||||
// navigate("/Project");
|
||||
navigate("/Dashboard");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user