From bb851d20201b45f21e7868e40bcba60210ce1ab9 Mon Sep 17 00:00:00 2001 From: jordan Date: Mon, 5 Aug 2024 17:55:43 -0700 Subject: [PATCH 1/3] corrections --- src/.graphclient/index.ts | 5 +++-- src/components/grant/MilestonesDrawer.tsx | 6 ++++-- src/constants/copy.ts | 4 ++-- src/graphql/newQueries/getUpdates.graphql | 4 ++-- src/pages/Project.tsx | 11 +++-------- src/pages/Ship.tsx | 4 +--- src/queries/getUpdates.ts | 8 ++++++-- src/types/common.ts | 7 +++++++ 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/.graphclient/index.ts b/src/.graphclient/index.ts index 7a4fd038..06ed4c53 100644 --- a/src/.graphclient/index.ts +++ b/src/.graphclient/index.ts @@ -10361,6 +10361,7 @@ export type getShipPoolIdQuery = { GrantShip: Array> } export type getUpdatesQueryVariables = Exact<{ entityAddress: Scalars['String']; + scope?: InputMaybe; }>; @@ -10987,9 +10988,9 @@ export const getShipPoolIdDocument = gql` } ` as unknown as DocumentNode; export const getUpdatesDocument = gql` - query getUpdates($entityAddress: String!) { + query getUpdates($entityAddress: String!, $scope: Int) { Update( - where: {entityAddress: {_eq: $entityAddress}} + where: {entityAddress: {_eq: $entityAddress}, scope: {_eq: $scope}} order_by: {timestamp: desc} ) { ...UpdateBody diff --git a/src/components/grant/MilestonesDrawer.tsx b/src/components/grant/MilestonesDrawer.tsx index a0cf141b..cded2d9f 100644 --- a/src/components/grant/MilestonesDrawer.tsx +++ b/src/components/grant/MilestonesDrawer.tsx @@ -4,6 +4,7 @@ import { Box, Button, Group, + NumberInput, Stack, Text, TextInput, @@ -238,8 +239,6 @@ export const MilestonesDrawer = ({ const alreadyHasMilestones = !!currentMilestoneSet; - console.log('formData', formData); - return ( @@ -290,10 +289,13 @@ export const MilestonesDrawer = ({ { refetch: refetchUpdates, } = useQuery({ queryKey: [`project-updates-${project?.id}`], - queryFn: () => getUpdates(project?.id as string), + queryFn: () => getUpdates(project?.id as string, UpdateScope.Project), enabled: !!project?.id, }); diff --git a/src/pages/Ship.tsx b/src/pages/Ship.tsx index be413969..d4349c9a 100644 --- a/src/pages/Ship.tsx +++ b/src/pages/Ship.tsx @@ -91,8 +91,6 @@ export const Ship = () => { enabled: !!id, }); - console.log('ship', ship); - const { userData } = useUserData(); const { @@ -223,7 +221,7 @@ export const Ship = () => { {ship.shipContractAddress && ( )} diff --git a/src/queries/getUpdates.ts b/src/queries/getUpdates.ts index 4ccf3210..7ce55ca7 100644 --- a/src/queries/getUpdates.ts +++ b/src/queries/getUpdates.ts @@ -1,11 +1,15 @@ import { getBuiltGraphSDK } from '../.graphclient'; import { resolveUpdates } from '../resolvers/updates'; +import { UpdateScope } from '../types/common'; -export const getUpdates = async (entityAddress: string) => { +export const getUpdates = async (entityAddress: string, scope: UpdateScope) => { try { const { getUpdates } = getBuiltGraphSDK(); - const result = await getUpdates({ entityAddress: entityAddress }); + const result = await getUpdates({ + entityAddress: entityAddress, + scope: scope, + }); if (!result.Update) { throw new Error('No updates found'); diff --git a/src/types/common.ts b/src/types/common.ts index e4bac537..c3553dcb 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -96,6 +96,13 @@ export enum VotingStage { Unknown, } +export enum UpdateScope { + Game, + Ship, + Project, + Grant, +} + export const formatBalance = (balance?: bigint) => { if (!balance || typeof balance !== 'bigint') return 0; return Number(Number(formatEther(balance)).toFixed(2)); From 992a4c8c0995aef20d1c112afcb4170033b8ad62 Mon Sep 17 00:00:00 2001 From: jordan Date: Mon, 5 Aug 2024 18:13:38 -0700 Subject: [PATCH 2/3] correct number input --- src/components/grant/MilestonesDrawer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/grant/MilestonesDrawer.tsx b/src/components/grant/MilestonesDrawer.tsx index cded2d9f..bc857409 100644 --- a/src/components/grant/MilestonesDrawer.tsx +++ b/src/components/grant/MilestonesDrawer.tsx @@ -289,7 +289,6 @@ export const MilestonesDrawer = ({ Date: Mon, 5 Aug 2024 18:22:35 -0700 Subject: [PATCH 3/3] update address --- src/constants/addresses.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index fafc0328..5f300e31 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -17,7 +17,7 @@ export const ADDR_PROD: Record = { ALLO: '0x1133eA7Af70876e64665ecD07C0A0476d09465a1', REGISTRY: '0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3', HATS: '0x3bc1A0Ad72417f2d411118085256fC53CBdDd137', - GAME_MANAGER: '0x012Dd40039884B2cBAf3582Ec6A259Bd0B1c8f0D', + GAME_MANAGER: '0x991aec0267985f415d86cacA00eF25a4ccc5488A', GM_FACTORY: '0xdc9787b869e22256a4f4f49f484586fcff0d351f', GS_FACTORY: '0x482a44043C67B92a69FAa47C5DA35453D88D140a', HATS_POSTER: '0x0B2BdeFf847D4AeB51F9f6aA3eC9AB63931E4191',