Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ inputs:
description: enables cypress
required: false
default: 'true'
NEXT_PUBLIC_FUNKIT_API_KEY:
description: funkit checkout API key (publishable, client-side). Without it the funkit checkout host stays unmounted.
required: false
default: ''

runs:
using: 'composite'
Expand Down Expand Up @@ -89,3 +93,4 @@ runs:
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: '${{ inputs.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }}'
NEXT_PUBLIC_NARVAL_CLIENT_ID: '${{ inputs.NEXT_PUBLIC_NARVAL_CLIENT_ID }}'
NEXT_PUBLIC_IS_CYPRESS_ENABLED: '${{ inputs.NEXT_PUBLIC_IS_CYPRESS_ENABLED }}'
NEXT_PUBLIC_FUNKIT_API_KEY: '${{ inputs.NEXT_PUBLIC_FUNKIT_API_KEY }}'
1 change: 1 addition & 0 deletions .github/workflows/build-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: ./.github/actions/build
with:
NEXT_PUBLIC_ENV: 'prod'
NEXT_PUBLIC_FUNKIT_API_KEY: ${{ secrets.FUNKIT_API_KEY }}
Comment thread
yogurtandjam marked this conversation as resolved.
Outdated

- name: Upload artifacts
uses: ./.github/actions/upload-artifacts
1 change: 1 addition & 0 deletions .github/workflows/build-test-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
NEXT_PUBLIC_NARVAL_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_NARVAL_CLIENT_ID }}
NEXT_PUBLIC_IS_CYPRESS_ENABLED: ${{ matrix.build.cypress_enabled }}
NEXT_PUBLIC_FUNKIT_API_KEY: ${{ secrets.FUNKIT_API_KEY }}

- name: Upload artifacts
uses: ./.github/actions/upload-artifacts
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
NEXT_PUBLIC_NARVAL_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_NARVAL_CLIENT_ID }}
NEXT_PUBLIC_IS_CYPRESS_ENABLED: ${{ matrix.build.cypress_enabled }}
NEXT_PUBLIC_FUNKIT_API_KEY: ${{ secrets.FUNKIT_API_KEY }}

- name: Upload artifacts
uses: ./.github/actions/upload-artifacts
Expand All @@ -58,6 +59,7 @@ jobs:
uses: ./.github/actions/build
with:
NEXT_PUBLIC_ENV: 'staging'
NEXT_PUBLIC_FUNKIT_API_KEY: ${{ secrets.FUNKIT_API_KEY }}

- name: Upload artifacts
uses: ./.github/actions/upload-artifacts
Expand Down
105 changes: 50 additions & 55 deletions pages/_app.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import dynamic from 'next/dynamic';
import Head from 'next/head';
import { ReactNode, useEffect, useState } from 'react';
import { AddressBlocked } from 'src/components/AddressBlocked';
import { DebugCrashBoundary } from 'src/components/DebugCrashBoundary';
import { Meta } from 'src/components/Meta';
import { TransactionEventHandler } from 'src/components/TransactionEventHandler';
import { GasStationProvider } from 'src/components/transactions/GasStation/GasStationProvider';
Expand Down Expand Up @@ -162,60 +161,56 @@ export default function MyApp(props: MyAppProps) {
imageUrl="https://app.aave.com/aave-com-opengraph.png"
/>
<NoSsr>
<DebugCrashBoundary label="app">
<AaveProvider client={client}>
<LanguageProvider>
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<ConnectKitProvider onDisconnect={cleanLocalStorage}>
<Web3ContextProvider>
<AppGlobalStyles>
<ComplianceProvider>
<AddressBlocked>
<SwapOrdersTrackingProvider>
<ModalContextProvider>
<SharedDependenciesProvider>
<AppDataProvider>
<GasStationProvider>
<DebugCrashBoundary label="page">
{getLayout(<Component {...pageProps} />)}
<SupplyModal />
<FunkitCheckout />
<WithdrawModal />
<BorrowModal />
<RepayModal />
<CollateralChangeModal />
<ClaimRewardsModal />
<EmodeModal />
<FaucetModal />
<TransactionEventHandler />
<StakingMigrateModal />
<BridgeModal />
<ReadOnlyModal />

{/* Swap Modals */}
<SwapModal />
<CollateralSwapModal />
<DebtSwapModal />
<CancelCowOrderModal />
<CowOrderToast />
</DebugCrashBoundary>
</GasStationProvider>
</AppDataProvider>
</SharedDependenciesProvider>
</ModalContextProvider>
</SwapOrdersTrackingProvider>
</AddressBlocked>
</ComplianceProvider>
</AppGlobalStyles>
</Web3ContextProvider>
</ConnectKitProvider>
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
</WagmiProvider>
</LanguageProvider>
</AaveProvider>
</DebugCrashBoundary>
<AaveProvider client={client}>
<LanguageProvider>
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<ConnectKitProvider onDisconnect={cleanLocalStorage}>
<Web3ContextProvider>
<AppGlobalStyles>
<ComplianceProvider>
<AddressBlocked>
<SwapOrdersTrackingProvider>
<ModalContextProvider>
<SharedDependenciesProvider>
<AppDataProvider>
<GasStationProvider>
{getLayout(<Component {...pageProps} />)}
<SupplyModal />
<FunkitCheckout />
<WithdrawModal />
<BorrowModal />
<RepayModal />
<CollateralChangeModal />
<ClaimRewardsModal />
<EmodeModal />
<FaucetModal />
<TransactionEventHandler />
<StakingMigrateModal />
<BridgeModal />
<ReadOnlyModal />

{/* Swap Modals */}
<SwapModal />
<CollateralSwapModal />
<DebtSwapModal />
<CancelCowOrderModal />
<CowOrderToast />
</GasStationProvider>
</AppDataProvider>
</SharedDependenciesProvider>
</ModalContextProvider>
</SwapOrdersTrackingProvider>
</AddressBlocked>
</ComplianceProvider>
</AppGlobalStyles>
</Web3ContextProvider>
</ConnectKitProvider>
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
</WagmiProvider>
</LanguageProvider>
</AaveProvider>
</NoSsr>
</CacheProvider>
);
Expand Down
53 changes: 0 additions & 53 deletions src/components/DebugCrashBoundary.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions src/components/transactions/FunCheckout/FunkitCheckout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ function InnerCheckout() {
}

export function FunkitCheckout() {
// funkit checkout is non-essential and non-functional without an API key
// (NEXT_PUBLIC_FUNKIT_API_KEY). FunkitProvider validates the config on render
// and throws "Invalid funkitConfig: Missing apiKey." on an empty key — and
// because this host is mounted globally in _app, that throw crashes the entire
// app on every page in any environment that doesn't inject the key (CI smoke
// builds, preview builds, local without .env). Render nothing instead: the
// Supply buttons fall back to the native modal because beginFunSupply() returns
// false when the island never registers on the bridge.
if (!funkitConfig.apiKey) {
return null;
}

return (
<FunkitProvider funkitConfig={funkitConfig} theme={aaveTheme} modalSize="medium">
<InnerCheckout />
Expand Down