Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wallet apps update #12627

Merged
merged 15 commits into from
Jun 23, 2023
Prev Previous commit
Next Next commit
rm connect app filter by address
  • Loading branch information
Jibz-Mysten committed Jun 23, 2023
commit 273ba80a4702337b446c759a9f664378d1f9c699
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useFeature } from '@growthbook/growthbook-react';
import cl from 'classnames';
import { useEffect, useMemo } from 'react';

import { useActiveAddress } from '../../hooks/useActiveAddress';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { permissionsSelectors } from '../../redux/slices/permissions';
import Loading from '../loading';
Expand All @@ -29,11 +28,10 @@ function ConnectedDapps() {
const ecosystemApps = useFeature<DAppEntry[]>(FEATURES.WALLET_DAPPS).value ?? emptyArray;
const loading = useAppSelector(({ permissions }) => !permissions.initialized);
const allPermissions = useAppSelector(permissionsSelectors.selectAll);
const activeAddress = useActiveAddress();
const connectedApps = useMemo(
() =>
allPermissions
.filter(({ allowed, accounts }) => allowed && accounts.includes(activeAddress!))
.filter(({ allowed, accounts }) => allowed)
.map((aPermission) => {
const matchedEcosystemApp = ecosystemApps.find((anEcosystemApp) => {
const originAdj = prepareLinkToCompare(aPermission.origin);
Expand Down Expand Up @@ -62,7 +60,7 @@ function ConnectedDapps() {
permissionID: aPermission.id,
};
}),
[activeAddress, allPermissions, ecosystemApps],
[allPermissions, ecosystemApps],
);
return (
<Loading loading={loading}>
Expand Down