+ {runStatus !== "finished" ? (
+
+ ) : null}
- {runStatus === "finished" ? (
-
- ) : (
- ""
- )}
{
@@ -25,11 +27,11 @@ const clearLSCache = () => {
localStorage.removeItem('walletName')
}
-export const getProfileDetails: any = createAsyncThunk("getProfileDetails", async (data: any, { }) => {
- localStorage.setItem('address', data.address)
- const response = await fetchData.get("/profile/current", data)
- // FOR MOCK - const response = await fetchData.get(data.url || 'static/data/current-profile.json', data)
- return response.data
+export const getProfileDetails: any = createAsyncThunk("getProfileDetails", async (data: any, { rejectWithValue }) => {
+ localStorage.setItem('address', data.address)
+ const response = await fetchData.get("/profile/current", data)
+ // FOR MOCK - const response = await fetchData.get(data.url || 'static/data/current-profile.json', data)
+ return response.data
})
export const authSlice = createSlice({
@@ -41,9 +43,13 @@ export const authSlice = createSlice({
clearLSCache();
},
logout: (state) => {
- clearLSCache()
+ clearLSCache();
+ state.loading = false;
return initialState
},
+ setNetwork: (state, actions) => {
+ state.network = actions.payload
+ }
},
extraReducers: (builder) => {
builder.addCase(getProfileDetails.pending, (state) => {state.loading = true;})
@@ -70,6 +76,6 @@ export const authSlice = createSlice({
});
-export const { logout, clearCache } = authSlice.actions;
+export const { logout, clearCache, setNetwork } = authSlice.actions;
export default authSlice.reducer;