This commit is contained in:
daniel31x13
2024-08-14 16:44:07 -04:00
parent 9cc3a7206e
commit 8031432995
19 changed files with 39 additions and 25 deletions
-10
View File
@@ -1,24 +1,14 @@
import { useEffect } from "react";
import { useSession } from "next-auth/react";
import useLocalSettingsStore from "@/store/localSettings";
import { useUser } from "./store/user";
export default function useInitialData() {
const { status, data } = useSession();
// const { setLinks } = useLinkStore();
const { data: user = {} } = useUser();
const { setSettings } = useLocalSettingsStore();
useEffect(() => {
setSettings();
}, [status, data]);
// Get the rest of the data
useEffect(() => {
if (user.id && (!process.env.NEXT_PUBLIC_STRIPE || user.username)) {
// setLinks();
}
}, [user]);
return status;
}