Skip to content

Commit

Permalink
refactor: remove unused selectedService reference and simplify master…
Browse files Browse the repository at this point in the history
…Safe assignment in useAddressesLogs
  • Loading branch information
mohandast52 committed Dec 19, 2024
1 parent 16049f8 commit 854609a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions frontend/hooks/useLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Eoa, WalletType } from '@/enums/Wallet';
import { Address } from '@/types/Address';
import { Service } from '@/types/Service';
import { Optional } from '@/types/Util';
import { asEvmChainId } from '@/utils/middlewareHelpers';

import { useBalanceContext } from './useBalanceContext';
import { useMultisigs } from './useMultisig';
Expand All @@ -13,7 +12,6 @@ import { useStore } from './useStore';
import { useMasterWalletContext } from './useWallet';

const useAddressesLogs = () => {
const { selectedService } = useServices();
const {
masterSafes,
masterEoa,
Expand Down Expand Up @@ -44,16 +42,11 @@ const useAddressesLogs = () => {
return result;
}, [masterSafesOwners, masterEoa]);

const masterSafe = masterSafes?.filter(
({ evmChainId }) =>
evmChainId === asEvmChainId(selectedService?.home_chain),
);

return {
isLoaded: masterWalletsIsFetched && masterSafesOwnersIsFetched,
data: [
{ masterEoa: masterEoa ?? 'undefined' },
{ masterSafe: masterSafe ?? 'undefined' },
{ masterSafe: masterSafes ?? 'undefined' },
{ masterSafeBackups: backupEoas ?? 'undefined' },
],
};
Expand Down

0 comments on commit 854609a

Please sign in to comment.