mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix: unable to show view as table modal (#21025)
This commit is contained in:
@@ -35,7 +35,7 @@ const Error = styled.pre`
|
||||
margin-top: ${({ theme }) => `${theme.gridUnit * 4}px`};
|
||||
`;
|
||||
|
||||
const cache = new WeakSet();
|
||||
const cache = new WeakMap();
|
||||
|
||||
export const useResultsPane = ({
|
||||
isRequest,
|
||||
@@ -59,6 +59,14 @@ export const useResultsPane = ({
|
||||
useEffect(() => {
|
||||
// it's an invalid formData when gets a errorMessage
|
||||
if (errorMessage) return;
|
||||
if (isRequest && cache.has(queryFormData)) {
|
||||
setResultResp(ensureIsArray(cache.get(queryFormData)));
|
||||
setResponseError('');
|
||||
if (queryForce && actions) {
|
||||
actions.setForceQuery(false);
|
||||
}
|
||||
setIsLoading(false);
|
||||
}
|
||||
if (isRequest && !cache.has(queryFormData)) {
|
||||
setIsLoading(true);
|
||||
getChartDataRequest({
|
||||
@@ -71,7 +79,7 @@ export const useResultsPane = ({
|
||||
.then(({ json }) => {
|
||||
setResultResp(ensureIsArray(json.result));
|
||||
setResponseError('');
|
||||
cache.add(queryFormData);
|
||||
cache.set(queryFormData, json.result);
|
||||
if (queryForce && actions) {
|
||||
actions.setForceQuery(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user