Moralis.User.current() shows old data

import { createAsyncThunk, createSlice, createAction } from "@reduxjs/toolkit";

/* import moralis */

const Moralis = require("moralis");
const serverUrl = process.env.REACT_APP_MORALIS_SERVER_URL;
const appId = process.env.REACT_APP_MORALIS_APPLICATION_ID;
const masterKey = process.env.MASTER_KEY;
//since balanceReducer is an extraReducer function. It is created
//by createAction class

export const fetchBalance = createAsyncThunk(
    "userBalance/fetchBalance",
    async() => {
        Moralis.start({ serverUrl, appId, masterKey });
        const currentUser = await Moralis.User.current();
        console.log(currentUser);
        var userAddress = currentUser['ethAddress'];
        console.log(userAddress)
        const query = new Moralis.Query('_User');
        console.log(query)
        query.equalTo("ethAddress", userAddress);
        const results = await query.find({ userMasterKey: true })
        return results;
    })

const userBalanceSlice = createSlice({
    name: "userBalance",
    initialState: {
        value: 0,
    },
    reducers: {},
    extraReducers: {
        [fetchBalance.fulfilled] (state, { payload }) {
            state.value = payload;
        }
    }
})



export const userBalance = (state) => state.userBalance.value;
export const balanceReducer = userBalanceSlice.reducer;

Moralis.User.current() always returns old data. That’s why I used Moralis.Query but the problem is not solved. I am using redux into ethereum-boilerplate-react

by old data you mean data before something got updated in the database?

yes. Although I change the data into the database. it shows the old one.

I think that you have to refetch the user data somehow in that case, or make a query to get the data that you expect to change

You should still be able to import from react-moralis