Skip to content

Commit

Permalink
Merge pull request #10837 from AugurProject/add-ga-instrumentation
Browse files Browse the repository at this point in the history
Add ga instrumentation
  • Loading branch information
mergify[bot] authored Mar 10, 2021
2 parents 47eaae3 + fe1f946 commit 86b8607
Show file tree
Hide file tree
Showing 9 changed files with 1,032 additions and 1,082 deletions.
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 @@ -124,6 +124,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 @@ -99,7 +99,7 @@ export function useHandleResize() {
}, []);
};

export function useCanExitCashPosition({ name, shareToken }: Cash) {
export function useCanExitCashPosition(cash: Cash) {
const {
account,
loginAccount,
Expand All @@ -117,7 +117,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 @@ -129,8 +130,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 @@ -140,7 +141,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

0 comments on commit 86b8607

Please sign in to comment.