fix(ui): fix duplicate options with selected option for teams (#16773)

This commit is contained in:
Chirag Madlani 2024-06-27 17:03:01 +05:30 committed by GitHub
parent ce6870d906
commit 1f1dfd42af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { isEmpty, isEqual } from 'lodash'; import { isEmpty, isEqual, uniqBy } from 'lodash';
import { DateRangeObject } from 'Models'; import { DateRangeObject } from 'Models';
import React, { import React, {
createContext, createContext,
@ -254,7 +254,7 @@ const DataInsightProvider = ({ children }: DataInsightProviderProps) => {
data: kpiList, data: kpiList,
}, },
teamFilter: { teamFilter: {
options: teamsOptions.options, options: uniqBy(teamsOptions.options, 'id'),
selectedKeys: teamsOptions.selectedOptions, selectedKeys: teamsOptions.selectedOptions,
onChange: handleTeamChange, onChange: handleTeamChange,
onGetInitialOptions: fetchDefaultTeamOptions, onGetInitialOptions: fetchDefaultTeamOptions,