fix: from other dashboard filters will confict 'requiredFirst' option then maxium render loop.

This commit is contained in:
the-last 2023-05-17 22:45:39 +08:00 committed by GitHub
parent 357745f418
commit 823df18ba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -269,7 +269,10 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
: null;
// firstItem[0] !== undefined for a case when groupby changed but new data still not fetched
// TODO: still need repopulate default value in config modal when column changed
if (firstItem?.[0] !== undefined) {
const searchParams = new URLSearchParams(window.location.search);
const searchFilters = searchParams.get('filters');
// avoid 'filters' of url to confict update with 'requiredFirst'; fix refresh again and again..
if (firstItem?.[0] !== undefined && !searchFilters) {
updateDataMask(firstItem);
}
} else if (isDisabled) {