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

fix: infinite loop dep, wrong fallback validation #172

Merged
merged 3 commits into from
Feb 7, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

- [#172](https://github.com/alleslabs/celatone-frontend/pull/172) Fix infinite loop dep, wrong fallback validation
- [#157](https://github.com/alleslabs/celatone-frontend/pull/157) Fix chain path bug when mixed up with query params
- [#154](https://github.com/alleslabs/celatone-frontend/pull/154) Stay on the same contract list page after renaming the list
- [#155](https://github.com/alleslabs/celatone-frontend/pull/155) Fix uncontrolled input error and fix space bar issue in editable cell
Expand Down
7 changes: 4 additions & 3 deletions src/lib/components/modal/contract/ContractDetailsTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/exhaustive-deps */
import { Flex, Text } from "@chakra-ui/react";
import { useCallback, useEffect, useMemo } from "react";
import { useForm } from "react-hook-form";
Expand Down Expand Up @@ -34,10 +35,10 @@ export const ContractDetailsTemplateModal = ({
};
}, [
contractLocalInfo.description,
contractLocalInfo.lists,
JSON.stringify(contractLocalInfo.lists),
contractLocalInfo.name,
contractLocalInfo.tags,
defaultList,
JSON.stringify(defaultList),
]);

const {
Expand All @@ -58,7 +59,7 @@ export const ContractDetailsTemplateModal = ({

useEffect(() => {
resetForm();
}, [defaultValues, resetForm]);
}, [resetForm]);

const offchainState = watch();

Expand Down
3 changes: 2 additions & 1 deletion src/lib/model/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const useCodeContractInstances = (
codeId: number,
offset: number,
pageSize: number
): Option<ContractInstances> => {
): ContractInstances => {
const { data: contractList } = useContractListByCodeId(
codeId,
offset,
Expand All @@ -47,6 +47,7 @@ export const useCodeContractInstances = (
...contract,
} as ContractLocalInfo;
});

return {
contractList: data,
count,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/contract-details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ContractDetailsBody = observer(
refetchRelatedProposals,
} = useContractDetailsTableCounts(contractAddress);

if (!contractData) return <InvalidContract />;
if (!contractData?.instantiateInfo) return <InvalidContract />;

return (
<>
Expand Down