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

Errors fixed to show login #494

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions frontend/components/ManageStakingPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CloseOutlined } from '@ant-design/icons';
import { Button, Card } from 'antd';

import { STAKING_PROGRAM_META } from '@/constants/stakingProgramMeta';
import { DEFAULT_STAKING_PROGRAM_ID } from '@/context/StakingProgramProvider';
import { STAKING_PROGRAMS } from '@/config/stakingPrograms';
import { Pages } from '@/enums/Pages';
import { StakingProgramId } from '@/enums/StakingProgram';
import { usePageState } from '@/hooks/usePageState';
import { useServices } from '@/hooks/useServices';
import { useStakingProgram } from '@/hooks/useStakingProgram';

import { CardTitle } from '../Card/CardTitle';
Expand All @@ -15,6 +15,7 @@ import { WhatAreStakingContractsSection } from './WhatAreStakingContracts';

export const ManageStakingPage = () => {
const { goto } = usePageState();
const { selectedAgentConfig } = useServices();
const { activeStakingProgramId } = useStakingProgram();

const orderedStakingProgramIds: StakingProgramId[] = Object.values(
Expand All @@ -26,14 +27,13 @@ export const ManageStakingPage = () => {
}

// put default at the top if no activeStakingProgram
if (
activeStakingProgramId === null &&
stakingProgramId === DEFAULT_STAKING_PROGRAM_ID
)
return [stakingProgramId, ...acc];
if (activeStakingProgramId) return [stakingProgramId, ...acc];

// if the program is deprecated, ignore it
if (STAKING_PROGRAM_META[stakingProgramId]?.deprecated) {
if (
STAKING_PROGRAMS[selectedAgentConfig.homeChainId][stakingProgramId]
.deprecated
) {
return acc;
}

Expand All @@ -43,7 +43,8 @@ export const ManageStakingPage = () => {

const otherStakingProgramIds = orderedStakingProgramIds.filter(
(stakingProgramId) => {
const info = STAKING_PROGRAM_META[stakingProgramId];
const info =
STAKING_PROGRAMS[selectedAgentConfig.homeChainId][stakingProgramId];
if (!info) return false;
if (activeStakingProgramId === stakingProgramId) return false;
if (info.deprecated) return false;
Expand Down
7 changes: 4 additions & 3 deletions frontend/hooks/useLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ const useAddressesLogs = () => {
if (!allMasterSafeOwners) return;

const result = allMasterSafeOwners
.map(({ owners }) =>
.map((masterSafeOwners) =>
masterSafeOwners.owners
.filter((owner): owner is Address => owner !== masterEoa.address)
.map<Eoa>((owner) => ({
address: owner,
type: WalletType.EOA,
safeAddress: owners.safeAddress,
chainId: owners.chainId,
safeAddress: masterSafeOwners.safeAddress,
chainId: masterSafeOwners.chainId,
})),
)
.flat();
Expand Down
Loading