Skip to content

Commit

Permalink
fix: worker env (#1048)
Browse files Browse the repository at this point in the history
* fix: worker env

* style: format code with Prettier

This commit fixes the style issues introduced in 2c8edee according to the output
from Prettier.

Details: #1048

---------

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
sasicodes and deepsource-autofix[bot] authored Oct 1, 2023
1 parent 21e2391 commit 9d8fbb4
Show file tree
Hide file tree
Showing 5 changed files with 11 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
7 changes: 5 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,9 @@ 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

3 comments on commit 9d8fbb4

@vercel
Copy link

@vercel vercel bot commented on 9d8fbb4 Oct 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

embed – ./apps/embed

embed-git-main-lenstube.vercel.app
embed-lenstube.vercel.app
embed.lenstube.xyz

@vercel
Copy link

@vercel vercel bot commented on 9d8fbb4 Oct 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

api – ./apps/api

api.lenstube.xyz
api-lenstube.vercel.app
api-git-main-lenstube.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9d8fbb4 Oct 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./apps/web

lenstube.xyz
www.lenstube.xyz
web-lenstube.vercel.app
web-git-main-lenstube.vercel.app

Please sign in to comment.