Skip to content
Snippets Groups Projects
Unverified Commit 8766bfa3 authored by Nicolò Pretto's avatar Nicolò Pretto Committed by GitHub
Browse files

fix type errors that appear on the mantine branch (#49590)


Co-Authored-by: default avatarPoom <poom@poom.dev>
parent 46191072
No related branches found
No related tags found
Loading
......@@ -80,10 +80,9 @@ const initialState: SdkState = {
};
export const sdk = createReducer(initialState, builder => {
builder.addCase(refreshTokenAsync.pending, state => ({
...state,
token: { ...state.token, loading: true },
}));
builder.addCase(refreshTokenAsync.pending, state => {
state.token = { ...state.token, loading: true };
});
builder.addCase(refreshTokenAsync.fulfilled, (state, action) => {
state.token = {
......@@ -111,38 +110,34 @@ export const sdk = createReducer(initialState, builder => {
state.loginStatus = { status: "error", error };
});
builder.addCase(setLoaderComponent, (state, action) => ({
...state,
loaderComponent: action.payload,
}));
builder.addCase(setPlugins, (state, action) => ({
...state,
plugins: action.payload,
}));
builder.addCase(setEventHandlers, (state, action) => ({
...state,
eventHandlers: action.payload,
}));
builder.addCase(setErrorComponent, (state, action) => ({
...state,
errorComponent: action.payload,
}));
builder.addCase(setMetabaseClientUrl, (state, action) => ({
...state,
metabaseInstanceUrl: action.payload,
}));
builder.addCase(setFetchRefreshTokenFn, (state, action) => ({
...state,
fetchRefreshTokenFn: action.payload,
}));
builder.addCase(setUsageProblem, (state, action) => ({
...state,
usageProblem: action.payload,
}));
builder.addCase(setLoaderComponent, (state, action) => {
state.loaderComponent = action.payload;
});
builder.addCase(setPlugins, (state, action) => {
// At the time of writing, doing `this.state.plugins = action.payload` causes
// `Type instantiation is excessively deep and possibly infinite.` for
// this specific action, but it fixes the others.
return { ...state, plugins: action.payload };
});
builder.addCase(setEventHandlers, (state, action) => {
state.eventHandlers = action.payload;
});
builder.addCase(setErrorComponent, (state, action) => {
state.errorComponent = action.payload;
});
builder.addCase(setMetabaseClientUrl, (state, action) => {
state.metabaseInstanceUrl = action.payload;
});
builder.addCase(setFetchRefreshTokenFn, (state, action) => {
state.fetchRefreshTokenFn = action.payload;
});
builder.addCase(setUsageProblem, (state, action) => {
state.usageProblem = action.payload;
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment