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

Add ga instrumentation #10837

Merged
merged 8 commits into from
Mar 10, 2021
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: 0 additions & 1 deletion packages/augur-comps/src/apollo/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export async function getMarketsData(updateHeartbeat) {
let newBlock = null;
try {
newBlock = await getPastDayBlockNumber(clientConfig.blockClient);
console.log(newBlock);
response = await augurV2Client(clientConfig.augurClient).query({
query: GET_MARKETS,
arguments: {
Expand Down
2 changes: 2 additions & 0 deletions packages/augur-comps/src/stores/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export const MOCK_APP_STATUS_STATE = {
...DEFAULT_APP_STATUS_STATE,
};

export const MAINNET = '1';
export const KOVAN = '42';
export const NETWORK_NAMES = {
1: 'Mainnet',
3: 'Ropsten',
Expand Down
11 changes: 6 additions & 5 deletions packages/augur-comps/src/stores/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const arrayToKeyedObjectByProp = (ArrayOfObj: any[], prop: string) =>

// CUSTOM HOOKS

export function useCanExitCashPosition({ name, shareToken }: Cash) {
export function useCanExitCashPosition(cash: Cash) {
const {
account,
loginAccount,
Expand All @@ -94,7 +94,8 @@ export function useCanExitCashPosition({ name, shareToken }: Cash) {
} = PARA_CONFIG;

useEffect(() => {
const checkCanCashExit = async () => {
const checkCanCashExit = async ({ name, shareToken }) => {
if (!name || !shareToken) return setCanExitPosition(false);
const approvalCheck = await isERC1155ContractApproved(
shareToken,
name === ETH ? WethWrapperForAMMExchange : AMMFactory,
Expand All @@ -106,8 +107,8 @@ export function useCanExitCashPosition({ name, shareToken }: Cash) {
if (Boolean(approvalCheck)) approvedAccount.current = loginAccount.account;
};

if (!!account && !!shareToken && (account !== approvedAccount.current || calledBlocknumber !== blocknumber)) {
checkCanCashExit();
if (!!account && !!cash && (account !== approvedAccount.current || calledBlocknumber !== blocknumber)) {
checkCanCashExit(cash);
setCalledBlocknumber(blocknumber);
}
}, [
Expand All @@ -117,7 +118,7 @@ export function useCanExitCashPosition({ name, shareToken }: Cash) {
transactions,
account,
blocknumber,
shareToken
cash
]);

return canExitPosition;
Expand Down
281 changes: 0 additions & 281 deletions packages/augur-comps/src/utils/constants.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/augur-simplified/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"react-dev-utils": "^11.0.1",
"react-dom": "^17.0.1",
"react-feather": "^2.0.9",
"react-ga": "^3.3.0",
"react-refresh": "^0.8.3",
"react-router-dom": "^5.2.0",
"react-tooltip": "^4.2.11",
Expand Down
2 changes: 2 additions & 0 deletions packages/augur-simplified/src/modules/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { AppStatusProvider, useAppStatusStore } from './stores/app-status';
import { Sidebar } from './sidebar/sidebar';
import classNames from 'classnames';
import ModalView from './modal/modal-view';
import { usePageView } from '../utils/tracker';
import { Stores, useUserStore, useGraphHeartbeat, useFinalizeUserTransactions, useUserBalances, GraphClient, PathUtils, Constants } from '@augurproject/augur-comps';
const { MARKETS } = Constants;
const { parsePath } = PathUtils;
Expand Down Expand Up @@ -57,6 +58,7 @@ const AppBody = () => {
useFinalizeUserTransactions();

useHandleResize();
usePageView();

useEffect(() => {
if (showTradingForm) {
Expand Down
Loading