Skip to content

Commit

Permalink
Merge pull request #84 from Eagle2gle/fix/#83-user-initial-state
Browse files Browse the repository at this point in the history
[bug] user 상태 관련 오류
  • Loading branch information
YuriKwon authored Mar 5, 2023
2 parents a749a36 + b052942 commit 2fc267b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/store/modules/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { createSlice, createAction } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';

type UserState = {
id: number | undefined;
token: string | undefined;
id: number | null;
token: string | null;
};

const hydrate = createAction<UserState>(HYDRATE);
const initialState: UserState = {
id: undefined,
token: undefined,
id: null,
token: null,
};
const userSlice = createSlice({
name: 'user',
Expand All @@ -25,8 +25,8 @@ const userSlice = createSlice({
state.id = action.payload;
},
logout: (state) => {
state.token = undefined;
state.id = undefined;
state.token = null;
state.id = null;
},
},
extraReducers: (builder) => {
Expand Down

0 comments on commit 2fc267b

Please sign in to comment.