Add typing to cookieData
This commit is contained in:
parent
84a7ca7733
commit
5d274a8336
1 changed files with 2 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ import "../styles/globals.scss"
|
||||||
|
|
||||||
function MyApp({ Component, pageProps }: AppProps) {
|
function MyApp({ Component, pageProps }: AppProps) {
|
||||||
const cookie = getCookie("account")
|
const cookie = getCookie("account")
|
||||||
const cookieData = cookie ? JSON.parse(cookie as string) : null
|
const cookieData: AccountCookie = cookie ? JSON.parse(cookie as string) : null
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (cookie) {
|
if (cookie) {
|
||||||
|
|
@ -19,7 +19,7 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||||
|
|
||||||
accountState.account.authorized = true
|
accountState.account.authorized = true
|
||||||
accountState.account.user = {
|
accountState.account.user = {
|
||||||
id: cookieData.user_id,
|
id: cookieData.userId,
|
||||||
username: cookieData.username,
|
username: cookieData.username,
|
||||||
picture: "",
|
picture: "",
|
||||||
element: "",
|
element: "",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue