diff --git a/apps/web/components/MoveButton.tsx b/apps/web/components/MoveButton.tsx index 95122cc..30d5d9b 100644 --- a/apps/web/components/MoveButton.tsx +++ b/apps/web/components/MoveButton.tsx @@ -12,7 +12,6 @@ interface MoveButtonProps { address?: Address tile: Address geohash: string - disabled?: boolean onMoveSuccess?: () => void name?: string } @@ -21,11 +20,10 @@ const MoveButton = ({ address, tile, geohash, - disabled, onMoveSuccess = () => {}, name = 'Move', }: MoveButtonProps) => { - const { config, isError, isLoading } = usePrepareMapMove({ + const { config, isError, isLoading, refetch } = usePrepareMapMove({ args: [address as Address, tile, geohash, toHex('')], enabled: !!address, }) @@ -44,6 +42,7 @@ const MoveButton = ({ }), () => { onMoveSuccess() + refetch() } ) @@ -52,7 +51,7 @@ const MoveButton = ({ onClick={() => { write && write() }} - disabled={isError || isLoading || pendingConfirm || indexing || disabled} + disabled={isError || isLoading || pendingConfirm || indexing} className={classNames('btn font-display', {})} > {(pendingConfirm || indexing) && ( diff --git a/apps/web/components/NetworkStateMotion.tsx b/apps/web/components/NetworkStateMotion.tsx index 9b9c0fa..5fe5e88 100644 --- a/apps/web/components/NetworkStateMotion.tsx +++ b/apps/web/components/NetworkStateMotion.tsx @@ -17,7 +17,7 @@ const NetworkStateMotion = ({ const { flyToGeohash } = useMapUtils() const { address } = useAccount() const { setPrecision, position } = usePosition() - const { geohashes, refetch } = useAppAgent() + const { refetch } = useAppAgent() useEffect(() => { flyToGeohash(position.geohash) @@ -56,7 +56,6 @@ const NetworkStateMotion = ({ address={address} tile={currentNetworkState?.id} geohash={position.geohash} - disabled={geohashes.includes(position.geohash)} onMoveSuccess={() => { refetch() }} diff --git a/apps/web/components/StateHeader.tsx b/apps/web/components/StateHeader.tsx index b70efef..c54c868 100644 --- a/apps/web/components/StateHeader.tsx +++ b/apps/web/components/StateHeader.tsx @@ -20,7 +20,7 @@ const StateHeader = ({ currentNetworkState, firstMove }: StateHeaderProps) => { const { flyToGeohash } = useMapUtils() const { address } = useAccount() const { setPrecision, position } = usePosition() - const { geohashes, refetch } = useAppAgent() + const { refetch } = useAppAgent() useEffect(() => { flyToGeohash(position.geohash) @@ -140,7 +140,6 @@ const StateHeader = ({ currentNetworkState, firstMove }: StateHeaderProps) => { address={address} tile={currentNetworkState?.id} geohash={position.geohash} - disabled={geohashes.includes(position.geohash)} onMoveSuccess={() => { refetch() }}