Skip to content

Commit

Permalink
chore: clean debug data
Browse files Browse the repository at this point in the history
  • Loading branch information
mastro993 committed Dec 18, 2024
1 parent e21ebe0 commit 71e3d6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
17 changes: 1 addition & 16 deletions ts/features/wallet/components/WalletCardsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
isWalletEmptySelector,
selectIsWalletCardsLoading,
selectWalletCategories,
selectWalletCategoryFilter,
selectWalletItwCards,
selectWalletOtherCards,
shouldRenderWalletEmptyStateSelector
Expand All @@ -44,8 +43,6 @@ const EID_INFO_BOTTOM_PADDING = 128;
const WalletCardsContainer = () => {
const isLoading = useIOSelector(selectIsWalletCardsLoading);
const isWalletEmpty = useIOSelector(isWalletEmptySelector);
const categories = useIOSelector(selectWalletCategories);
const selectedCategory = useIOSelector(selectWalletCategoryFilter);
const shouldRenderEmptyState = useIOSelector(
shouldRenderWalletEmptyStateSelector
);
Expand All @@ -54,17 +51,6 @@ const WalletCardsContainer = () => {
// placeholders in the wallet
const shouldRenderLoadingState = isLoading && isWalletEmpty;

useDebugInfo({
wallet: {
isLoading,
isWalletEmpty,
categories,
selectedCategory,
shouldRenderEmptyState,
shouldRenderLoadingState
}
});

// Content to render in the wallet screen, based on the current state
const walletContent = React.useMemo(() => {
if (shouldRenderLoadingState) {
Expand Down Expand Up @@ -117,11 +103,10 @@ const ItwWalletCardsContainer = withWalletCategoryFilter("itw", () => {

useDebugInfo({
itw: {
cards,
isItwValid,
isItwEnabled,
eidStatus,
isEidExpired
cards
}
});

Expand Down
16 changes: 12 additions & 4 deletions ts/features/wallet/components/WalletCategoryFilterTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
selectWalletCategoryFilter
} from "../store/selectors";
import { walletCardCategoryFilters } from "../types";
import { useDebugInfo } from "../../../hooks/useDebugInfo";

/**
* Renders filter tabs to categorize cards on the wallet home screen.
Expand All @@ -23,17 +24,24 @@ import { walletCardCategoryFilters } from "../types";
const WalletCategoryFilterTabs = () => {
const dispatch = useIODispatch();

const selectedCategory = useIOSelector(selectWalletCategoryFilter);
const categoryFilter = useIOSelector(selectWalletCategoryFilter);
const isFilteringEnabled = useIOSelector(
isWalletCategoryFilteringEnabledSelector
);

useDebugInfo({
wallet: {
isFilteringEnabled,
categoryFilter
}
});

const selectedIndex = React.useMemo(
() =>
selectedCategory
? walletCardCategoryFilters.indexOf(selectedCategory) + 1
categoryFilter
? walletCardCategoryFilters.indexOf(categoryFilter) + 1
: 0,
[selectedCategory]
[categoryFilter]
);

if (!isFilteringEnabled) {
Expand Down

0 comments on commit 71e3d6e

Please sign in to comment.