Skip to content

Commit

Permalink
Merge pull request #2071 from decentdao/hotfix/v0.2.8
Browse files Browse the repository at this point in the history
Hotfix/v0.2.8
  • Loading branch information
adamgall authored Jul 3, 2024
2 parents 3fa0156 + 5f6f650 commit 795080c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "decent-interface",
"version": "0.2.7",
"version": "0.2.8",
"private": true,
"dependencies": {
"@apollo/client": "^3.7.10",
Expand Down
20 changes: 19 additions & 1 deletion src/hooks/DAO/loaders/governance/useAzoriusProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { logError } from '../../../../helpers/errorLogging';
import { useFractal } from '../../../../providers/App/AppProvider';
import { FractalGovernanceAction } from '../../../../providers/App/governance/action';
import { useEthersProvider } from '../../../../providers/Ethers/hooks/useEthersProvider';
import { useNetworkConfig } from '../../../../providers/NetworkConfig/NetworkConfigProvider';
import {
CreateProposalMetadata,
VotingStrategyType,
Expand All @@ -30,6 +31,7 @@ type OnProposalLoaded = (proposal: AzoriusProposal) => void;
export const useAzoriusProposals = () => {
const currentAzoriusAddress = useRef<string>();
const { setValue, getValue } = useLocalStorage();
const network = useNetworkConfig();

const {
governanceContracts: {
Expand Down Expand Up @@ -179,6 +181,15 @@ export const useAzoriusProposals = () => {
const propasalCacheKeyPrefix = `${CacheKeys.PROPOSAL_PREFIX}_${azoriusContractAddress}`;

for (const proposalCreatedEvent of proposalCreatedEvents) {
if (
// oops
network.chain.id === 1 && // mainnet
azoriusContract?.address === '0x61BC890acf131f8dbd9C1DF8638b3c333dc1c6eC' && // decent dao's azorius
proposalCreatedEvent.args[1].eq(0) // proposal id 0
) {
continue;
}

const cachedProposal = getValue(
`${propasalCacheKeyPrefix}_${proposalCreatedEvent.args.proposalId.toString()}`,
) as AzoriusProposal;
Expand Down Expand Up @@ -271,7 +282,14 @@ export const useAzoriusProposals = () => {
payload: true,
});
},
[action, azoriusContractAddress, getValue, setValue],
[
action,
azoriusContractAddress,
network.chain.id,
azoriusContract?.address,
getValue,
setValue,
],
);

return (proposalLoaded: OnProposalLoaded) =>
Expand Down

0 comments on commit 795080c

Please sign in to comment.