This commit is contained in:
Flatlogic Bot 2025-08-26 15:02:37 +00:00
parent 22a7753a4f
commit 457e9f6301
2 changed files with 4 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -81,6 +81,7 @@ export const authSlice = createSlice({
extraReducers: (builder) => { extraReducers: (builder) => {
builder.addCase(loginUser.pending, (state) => { builder.addCase(loginUser.pending, (state) => {
state.isFetching = true; state.isFetching = true;
state.errorMessage = '';
}); });
builder.addCase(loginUser.fulfilled, (state, action) => { builder.addCase(loginUser.fulfilled, (state, action) => {
const token = action.payload; const token = action.payload;
@ -94,7 +95,7 @@ export const authSlice = createSlice({
}); });
builder.addCase(loginUser.rejected, (state, action) => { builder.addCase(loginUser.rejected, (state, action) => {
state.errorMessage = String(action.payload) || 'Something went wrong. Try again'; state.errorMessage = action.payload?.message || action.error?.message || 'Something went wrong. Try again';
state.isFetching = false; state.isFetching = false;
}); });
builder.addCase(findMe.pending, () => { builder.addCase(findMe.pending, () => {