diff --git a/packages/extension-koni-ui/src/Popup/Home/Cards/ToolFiters/ToolFiltersModal.tsx b/packages/extension-koni-ui/src/Popup/Home/Cards/ToolFiters/ToolFiltersModal.tsx index 715292d3a8..a482116bf4 100644 --- a/packages/extension-koni-ui/src/Popup/Home/Cards/ToolFiters/ToolFiltersModal.tsx +++ b/packages/extension-koni-ui/src/Popup/Home/Cards/ToolFiters/ToolFiltersModal.tsx @@ -19,7 +19,6 @@ interface Props extends ThemeProps { setNumberOptionsSelected: Dispatch>; tmpItemsSelected: FilterOptionsSelected; setTmpItemsSelected: Dispatch>; - isLinkedMyth: boolean; onConfirm: () => void; handleCancel: () => void; handleReset: () => void; @@ -45,7 +44,7 @@ const DEFAULT_FILTER_OPTIONS_SELECTED: FilterOptionsSelected = { const modalId = 'filter-modal-id'; -const Component = ({ className, filterItems, handleCancel, handleReset, isLinkedMyth, onConfirm, setConditionProcess, setNumberOptionsSelected, setTmpItemsSelected, tmpItemsSelected }: Props): React.ReactElement => { +const Component = ({ className, filterItems, handleCancel, handleReset, onConfirm, setConditionProcess, setNumberOptionsSelected, setTmpItemsSelected, tmpItemsSelected }: Props): React.ReactElement => { const { t } = useTranslation(); const { inactiveModal } = useContext(ModalContext); @@ -93,7 +92,7 @@ const Component = ({ className, filterItems, handleCancel, handleReset, isLinked return [...prev].filter((card) => { const isCardPositionPassed = tmpItemsSelected[FilterOption.POSITION_OPTION].length === 0 || tmpItemsSelected[FilterOption.POSITION_OPTION].includes(card.position); const isCardProgramPassed = tmpItemsSelected[FilterOption.PROGRAM_OPTION].length === 0 || tmpItemsSelected[FilterOption.PROGRAM_OPTION].includes(card.program); - const isCardRarityPassed = tmpItemsSelected[FilterOption.RARITY_OPTION].length === 0 || (tmpItemsSelected[FilterOption.RARITY_OPTION].includes(card.rarity) && isLinkedMyth); + const isCardRarityPassed = tmpItemsSelected[FilterOption.RARITY_OPTION].length === 0 || (tmpItemsSelected[FilterOption.RARITY_OPTION].includes(card.rarity) && card.program !== 'default'); const isCardTeamPassed = tmpItemsSelected[FilterOption.TEAM_OPTION].length === 0 || tmpItemsSelected[FilterOption.TEAM_OPTION].includes(card.team); let isCardPowerPassed = tmpItemsSelected[FilterOption.POWER_OPTION].length === 0; @@ -124,7 +123,7 @@ const Component = ({ className, filterItems, handleCancel, handleReset, isLinked onConfirm(); inactiveModal('filter-modal-id'); - }, [inactiveModal, isLinkedMyth, onConfirm, setConditionProcess, setNumberOptionsSelected, tmpItemsSelected]); + }, [inactiveModal, onConfirm, setConditionProcess, setNumberOptionsSelected, tmpItemsSelected]); const footerContent = useMemo(() => { return ( diff --git a/packages/extension-koni-ui/src/Popup/Home/Cards/ToolFiters/index.tsx b/packages/extension-koni-ui/src/Popup/Home/Cards/ToolFiters/index.tsx index f4fd18bdaf..65ceaf8088 100644 --- a/packages/extension-koni-ui/src/Popup/Home/Cards/ToolFiters/index.tsx +++ b/packages/extension-koni-ui/src/Popup/Home/Cards/ToolFiters/index.tsx @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { LevelOptions, PositionOptions, PowerOptions, ProgramOptions, RarityOptions, TeamOptions } from '@subwallet/extension-koni-ui/constants/myth'; -import { AuthenticationMythContext } from '@subwallet/extension-koni-ui/contexts/AuthenticationMythProvider'; import { useTranslation } from '@subwallet/extension-koni-ui/hooks'; import { ConditionProcessState } from '@subwallet/extension-koni-ui/Popup/Home/Cards'; import { FilterOptionsSelected, ToolFiltersModal } from '@subwallet/extension-koni-ui/Popup/Home/Cards/ToolFiters/ToolFiltersModal'; @@ -56,7 +55,7 @@ const Component = ({ className, setConditionProcess }: Props): React.ReactElemen const { activeModal } = useContext(ModalContext); const [numberOptionsSelected, setNumberOptionsSelected] = useState(0); const [tmpItemsSelected, setTmpItemsSelected] = useState(_.cloneDeep(DEFAULT_FILTER_OPTIONS_SELECTED)); - const { isLinkedMyth } = useContext(AuthenticationMythContext); + const [itemsSelected, setItemsSelected] = useState(DEFAULT_FILTER_OPTIONS_SELECTED); const handleConfirmSelection = useCallback(() => { @@ -115,7 +114,6 @@ const Component = ({ className, setConditionProcess }: Props): React.ReactElemen filterItems={FilterOptions} handleCancel={handleCancel} handleReset={handleReset} - isLinkedMyth={isLinkedMyth} onConfirm={handleConfirmSelection} setConditionProcess={setConditionProcess} setNumberOptionsSelected={setNumberOptionsSelected}