Skip to content

Commit

Permalink
fix: undefined env variable (#11412)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleBill committed Feb 20, 2024
1 parent f6da159 commit 0753775
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/mask/.webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export async function createConfiguration(_inputFlags: BuildFlags): Promise<webp
NODE_DEBUG: false,
WEB3_CONSTANTS_RPC: process.env.WEB3_CONSTANTS_RPC ?? '',
MASK_SENTRY_DSN: process.env.MASK_SENTRY_DSN ?? '',
NEXT_PUBLIC_FIREFLY_API_URL: process.env.NEXT_PUBLIC_FIREFLY_API_URL || '',
}),
new DefinePlugin({
'process.browser': 'true',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default function RedPacketDialog(props: RedPacketDialogProps) {
const [rpid, setRpid] = useState<string>('')
const [showClaimRule, setShowClaimRule] = useState(false)
const [gasOption, setGasOption] = useState<GasConfig>()
const isFirefly = !!props.fireflyContext

const [step, setStep] = useState(CreateRedPacketPageStep.NewRedPacketPage)

Expand Down Expand Up @@ -127,8 +128,6 @@ export default function RedPacketDialog(props: RedPacketDialogProps) {
const [openSelectNFTDialog, setOpenSelectNFTDialog] = useState(false)
// #endregion

const isFirefly = useMemo(() => !!props.fireflyContext, [props.fireflyContext])

const handleClose = useCallback(() => {
setStep(CreateRedPacketPageStep.NewRedPacketPage)
setSettings(undefined)
Expand Down
8 changes: 4 additions & 4 deletions packages/plugins/RedPacket/src/SiteAdaptor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const site: Plugin.SiteAdaptor.Definition = {
(_payload) => {
return {
text: (
<ERC20RedpacketBadge
<RedpacketBadge
message={(_payload as RedPacketJSONPayload).sender.message}
fallback={'A Token Lucky Drop'}
/>
Expand All @@ -77,7 +77,7 @@ const site: Plugin.SiteAdaptor.Definition = {
(_payload) => {
return {
text: (
<ERC20RedpacketBadge
<RedpacketBadge
message={(_payload as RedPacketNftJSONPayload).message}
fallback={'An NFT Lucky Drop'}
/>
Expand Down Expand Up @@ -142,12 +142,12 @@ const site: Plugin.SiteAdaptor.Definition = {
'linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 100%), linear-gradient(90deg, rgba(28, 104, 243, 0.2) 0%, rgba(249, 55, 55, 0.2) 100%), #FFFFFF',
},
}
interface ERC20RedpacketBadgeProps {
interface RedpacketBadgeProps {
message: string
fallback: string
}

function ERC20RedpacketBadge(props: ERC20RedpacketBadgeProps) {
function RedpacketBadge(props: RedpacketBadgeProps) {
const { message, fallback } = props

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-providers/src/Firefly/RedPacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { FireflyRedPacketAPI } from '../entry-types.js'

const siteType = getSiteType()
const SITE_URL = siteType === EnhanceableSite.Firefly ? location.origin : 'https://firefly.mask.social'
const FIREFLY_ROOT_URL = process.env.NEXT_PUBLIC_FIREFLY_API_URL ?? 'https://api.firefly.land'
const FIREFLY_ROOT_URL = process.env.NEXT_PUBLIC_FIREFLY_API_URL || 'https://api.firefly.land'

const themes = [
{
Expand Down

0 comments on commit 0753775

Please sign in to comment.