Skip to content

Commit

Permalink
fix: worker env
Browse files Browse the repository at this point in the history
  • Loading branch information
sasicodes committed Oct 1, 2023
1 parent 21e2391 commit 2c8edee
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
10 changes: 3 additions & 7 deletions apps/web/src/components/Home/OpenActions/Zora/ZoraNft.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import CollectOutline from '@components/Common/Icons/CollectOutline'
import UserPreview from '@components/Common/UserPreview'
import Modal from '@components/UIElements/Modal'
import { LENSTUBE_ADDRESS } from '@lenstube/constants'
import {
getZoraChainIsMainnet,
trimLensHandle,
useZoraNft
} from '@lenstube/generic'
import { LENSTUBE_ADDRESS, ZORA_MAINNET_CHAINS } from '@lenstube/constants'
import { trimLensHandle, useZoraNft } from '@lenstube/generic'
import type { Profile } from '@lenstube/lens'
import type { BasicNftMetadata } from '@lenstube/lens/custom-types'
import { getShortHandTime } from '@lib/formatTime'
Expand Down Expand Up @@ -38,7 +34,7 @@ const ZoraNft: FC<Props> = ({ nftMetadata, sharedBy, postedAt }) => {
return null
}

const network = getZoraChainIsMainnet(chain) ? '' : 'testnet.'
const network = ZORA_MAINNET_CHAINS.includes(chain) ? '' : 'testnet.'
const zoraLink = `https://${network}zora.co/collect/${chain}:${address}${
token ? `/${token}` : ''
}?referrer=${LENSTUBE_ADDRESS}`
Expand Down
3 changes: 3 additions & 0 deletions packages/constants/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,6 @@ export const ALLOWED_HEX_CHARACTERS = [
'E',
'F'
]

// open actions
export const ZORA_MAINNET_CHAINS = ['eth', 'oeth', 'base', 'zora']
5 changes: 0 additions & 5 deletions packages/helpers/generic/functions/getZoraChainIsMainnet.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/helpers/generic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export * from './functions/getSignature'
export * from './functions/getThumbnailUrl'
export * from './functions/getURLs'
export * from './functions/getZoraChainInfo'
export * from './functions/getZoraChainIsMainnet'
export * from './functions/imageCdn'
export * from './functions/isWatchable'
export * from './functions/omitKey'
Expand Down
5 changes: 3 additions & 2 deletions packages/workers/nfts/src/handlers/getZoraNft.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { WorkerRequest } from '../types'
import { getZoraChainIsMainnet } from '@lenstube/generic'

const ZORA_MAINNET_CHAINS = ['eth', 'oeth', 'base', 'zora']

export default async (request: WorkerRequest) => {
const { chain, address, token } = request.query
Expand All @@ -14,7 +15,7 @@ export default async (request: WorkerRequest) => {
}

try {
const network = getZoraChainIsMainnet(chain as string) ? '' : 'testnet.'
const network = ZORA_MAINNET_CHAINS.includes(chain as string) ? '' : 'testnet.'
const zoraResponse = await fetch(
`https://${network}zora.co/api/personalize/collection/${chain}:${address}/${
token || ''
Expand Down

0 comments on commit 2c8edee

Please sign in to comment.