Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
compojoom committed Mar 8, 2024
1 parent a46aa46 commit 66b1f60
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/components/swap/CowWidgetCommunicator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type CowSwapWidgetParams, TradeType, CowSwapWidget } from '@cowprotocol/widget-react'
import { CowEvents, type CowEventListeners, type ToastMessageType } from '@cowprotocol/events'
import { CowEvents, type CowEventListeners } from '@cowprotocol/events'
import { useState, useEffect, type MutableRefObject, useMemo } from 'react'
import { Container, Grid, useTheme } from '@mui/material'
import useChainId from '@/hooks/useChainId'
Expand All @@ -14,7 +14,7 @@ import { useCurrentChain } from '@/hooks/useChains'
import { useDarkMode } from '@/hooks/useDarkMode'
import { useCustomAppCommunicator } from '@/hooks/safe-apps/useCustomAppCommunicator'
import { showNotification } from '@/store/notificationsSlice'
import { useAppDispatch, useAppSelector } from '@/store'
import { useAppDispatch } from '@/store'

const supportedChains = [1, 100, 11155111]

Expand Down Expand Up @@ -59,11 +59,6 @@ export const CowWidgetCommunicator = ({ sell }: Params) => {
setToasts((t) => t.slice(1))
}

// SWAP_ETH_FLOW_SENT_TX = "SWAP_ETH_FLOW_SENT_TX",
// SWAP_POSTED_API = "SWAP_POSTED_API",
// SWAP_SIGNING_ERROR = "SWAP_SIGNING_ERROR",
// SWAP_TRADE_EXECUTED = "SWAP_TRADE_EXECUTED",
// SWAP_ORDER_CANCELLED = "SWAP_ORDER_CANCELLED"
const groupKey = 'swap-order-status'
const listeners = useMemo<CowEventListeners>(() => {
return [
Expand All @@ -73,6 +68,7 @@ export const CowWidgetCommunicator = ({ sell }: Params) => {
console.info('🍞 New toast message:', event)
const { message, messageType, data } = event
switch (messageType) {
// @ts-ignore
case 'ORDER_CREATED':
dispatch(
showNotification({
Expand All @@ -83,6 +79,7 @@ export const CowWidgetCommunicator = ({ sell }: Params) => {
}),
)
break
// @ts-ignore
case 'ORDER_PRESIGNED':
dispatch(
showNotification({
Expand All @@ -93,6 +90,7 @@ export const CowWidgetCommunicator = ({ sell }: Params) => {
}),
)
break
// @ts-ignore
case 'ORDER_FULFILLED':
dispatch(
showNotification({
Expand All @@ -103,6 +101,7 @@ export const CowWidgetCommunicator = ({ sell }: Params) => {
}),
)
break
// @ts-ignore
case 'ORDER_EXPIRED':
dispatch(
showNotification({
Expand All @@ -113,6 +112,7 @@ export const CowWidgetCommunicator = ({ sell }: Params) => {
}),
)
break
// @ts-ignore
case 'ORDER_CANCELLED':
dispatch(
showNotification({
Expand All @@ -127,7 +127,6 @@ export const CowWidgetCommunicator = ({ sell }: Params) => {
openToast(event.message)
},
},

]
}, [openToast])

Expand Down

0 comments on commit 66b1f60

Please sign in to comment.