Skip to content

Commit

Permalink
added fix for coinbase
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehaz committed Jun 14, 2024
1 parent 6ceb54e commit d395b07
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/components/pages/home-page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import * as dropAsyncActions from 'data/store/reducers/drop/async-actions'
import { connect } from 'react-redux'
import LinkdropLogo from 'images/linkdrop.png'
import LinkdropLogoLight from 'images/linkdrop-light.png'
import { defineApplicationConfig } from 'helpers'
import { defineApplicationConfig, defineSystem } from 'helpers'
import { TSystem } from 'types'

const mapStateToProps = ({
user: { address, provider, chainId, initialized },
Expand All @@ -32,14 +33,16 @@ const mapStateToProps = ({
const mapDispatcherToProps = (dispatch: IAppDispatch) => {
return {
getLink: (
code: string,
callback: (claimCode: string) => void
) => dispatch(
dropAsyncActions.getLinkFromInput(
code,
callback
)
code: string,
system: TSystem,
callback: (claimCode: string) => void
) => dispatch(
dropAsyncActions.getLinkFromInput(
code,
system,
callback
)
)
}
}

Expand All @@ -53,9 +56,10 @@ const HomePage: FC<ReduxType> = ({
const [ code, setCode ] = useState<string>('')
const [ error, setError ] = useState<string | undefined>(undefined)
const configs = defineApplicationConfig()
const system = defineSystem()

const onClick = async () => {
const link = await getLink(code, (claimCode) => {
const link = await getLink(code, system, (claimCode) => {
history.push(`/redeem/${claimCode}`)
})
setError(undefined)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import * as asyncActionsDrop from '.'
import axios, { AxiosError } from 'axios'
import { IAppDispatch } from 'data/store'
import { plausibleApi } from 'data/api'
import { TSystem } from 'types';

export default function getLinkFromInput(
linkCode: string,
system: TSystem,
callback: (location: string) => void
) {
return async (
Expand All @@ -18,6 +20,7 @@ export default function getLinkFromInput(
try {
const link = await dispatch(asyncActionsDrop.getLinkByCode(
linkCode,
system,
callback
))
plausibleApi.invokeEvent({
Expand Down

0 comments on commit d395b07

Please sign in to comment.