fix: remove all unused variables and added dependecies to useEffect and useCallback (#3013)

This commit is contained in:
Aaryan Khandelwal 2023-12-06 20:31:42 +05:30 committed by sriram veeraghanta
parent 691666e5e2
commit 92cb1834a5
23 changed files with 89 additions and 95 deletions

View file

@ -36,7 +36,7 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
const {
user: { currentUser, updateCurrentUser, updateUserOnBoard },
workspace: workspaceStore,
trackEvent: { postHogEventTracker }
trackEvent: { postHogEventTracker },
} = useMobxStore();
const router = useRouter();
@ -78,19 +78,18 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
const finishOnboarding = async () => {
if (!user || !workspaces) return;
await updateUserOnBoard().then(() => {
postHogEventTracker(
"USER_ONBOARDING_COMPLETE",
{
await updateUserOnBoard()
.then(() => {
postHogEventTracker("USER_ONBOARDING_COMPLETE", {
user_role: user.role,
email: user.email,
user_id: user.id,
status: "SUCCESS"
}
)
}).catch((error) => {
console.log(error);
})
status: "SUCCESS",
});
})
.catch((error) => {
console.log(error);
});
router.replace(`/${workspaces[0].slug}`);
};
@ -133,7 +132,7 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
};
handleStepChange();
}, [user, invitations, step]);
}, [user, invitations, step, updateCurrentUser, workspaces]);
return (
<>