From d6687acabf0b2ee90bc3e3a806dde685e058d5c8 Mon Sep 17 00:00:00 2001 From: prxt6529 Date: Wed, 11 Feb 2026 12:39:24 +0200 Subject: [PATCH 1/7] Mint for me - profile wallet selection Signed-off-by: prxt6529 --- .../ManifoldMintingConnect.test.tsx | 41 ++++++ components/auth/SeizeConnectContext.tsx | 29 +++- components/common/RecipientSelector.tsx | 110 ++++++++++----- .../ManifoldMintingConnect.tsx | 129 ++++++++++++++---- 4 files changed, 241 insertions(+), 68 deletions(-) diff --git a/__tests__/components/manifoldMinting/ManifoldMintingConnect.test.tsx b/__tests__/components/manifoldMinting/ManifoldMintingConnect.test.tsx index 18fb21c596..2959dd1d96 100644 --- a/__tests__/components/manifoldMinting/ManifoldMintingConnect.test.tsx +++ b/__tests__/components/manifoldMinting/ManifoldMintingConnect.test.tsx @@ -20,6 +20,11 @@ jest.mock('@/components/user/utils/UserCICAndLevel', () => ({ UserCICAndLevelSize: { XLARGE: 'XLARGE' }, })); +jest.mock('@/components/nft-transfer/TransferModalPfp', () => ({ + __esModule: true, + default: () =>
, +})); + let mockOnProfileSelect: ((profile: any) => void) | null = null; let mockOnWalletSelect: ((wallet: string | null) => void) | null = null; @@ -85,6 +90,42 @@ describe('ManifoldMintingConnect', () => { expect(onMintFor).toHaveBeenCalledWith(seizeCtx.address); }); + it('lets mint for me switch wallet inside connected profile', async () => { + const { onMintFor } = renderConnected(); + const alternateWallet = '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; + + if (mockOnWalletSelect) { + mockOnWalletSelect(alternateWallet); + } + + await waitFor(() => + expect(onMintFor).toHaveBeenLastCalledWith(alternateWallet) + ); + }); + + it('reselects connected wallet when switching back to mint for me', async () => { + const { onMintFor, seizeCtx } = renderConnected(); + const alternateWallet = '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; + const frenWallet = '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; + + if (mockOnWalletSelect) { + mockOnWalletSelect(alternateWallet); + } + await waitFor(() => + expect(onMintFor).toHaveBeenLastCalledWith(alternateWallet) + ); + + await userEvent.click(screen.getByRole('button', { name: /Mint for fren/i })); + if (mockOnProfileSelect && mockOnWalletSelect) { + mockOnProfileSelect({ handle: 'fren', wallet: frenWallet }); + mockOnWalletSelect(frenWallet); + } + await waitFor(() => expect(onMintFor).toHaveBeenLastCalledWith(frenWallet)); + + await userEvent.click(screen.getByRole('button', { name: /Mint for me/i })); + await waitFor(() => expect(onMintFor).toHaveBeenLastCalledWith(seizeCtx.address)); + }); + it('shows RecipientSelector when mint for fren is clicked', async () => { renderConnected(); await userEvent.click(screen.getByRole('button', { name: /Mint for fren/i })); diff --git a/components/auth/SeizeConnectContext.tsx b/components/auth/SeizeConnectContext.tsx index 6a883b2490..e21cdcabec 100644 --- a/components/auth/SeizeConnectContext.tsx +++ b/components/auth/SeizeConnectContext.tsx @@ -10,6 +10,7 @@ import React, { useState, } from "react"; +import { getNodeEnv, publicEnv } from "@/config/env"; import { getWalletAddress, removeAuthJwt } from "@/services/auth/auth.utils"; import { WalletInitializationError } from "@/src/errors/wallet"; import { SecurityEventType } from "@/src/types/security"; @@ -364,6 +365,16 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({ isInitialized, } = useConsolidatedWalletState(); const debounceTimeoutRef = useRef(null); + const nodeEnv = getNodeEnv(); + const isDevLikeEnv = + nodeEnv === "development" || nodeEnv === "test" || nodeEnv === "local"; + const impersonatedAddress = + isDevLikeEnv && + publicEnv.USE_DEV_AUTH === "true" && + publicEnv.DEV_MODE_WALLET_ADDRESS && + isAddress(publicEnv.DEV_MODE_WALLET_ADDRESS) + ? getAddress(publicEnv.DEV_MODE_WALLET_ADDRESS) + : undefined; useEffect(() => { // Wait for initialization to complete before processing account changes @@ -378,6 +389,16 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({ // Use debounced state update to prevent race conditions debounceTimeoutRef.current = setTimeout(() => { + if (impersonatedAddress) { + const isAlreadyConnected = + walletState.status === "connected" && + walletState.address === impersonatedAddress; + if (!isAlreadyConnected) { + setConnected(impersonatedAddress); + } + return; + } + if (account.address && account.isConnected) { // Validate and normalize address to checksummed format if (isAddress(account.address)) { @@ -442,6 +463,7 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({ setConnected, setDisconnected, setConnecting, + impersonatedAddress, ]); const seizeConnect = useCallback((): void => { @@ -584,7 +606,7 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({ const contextValue = useMemo( (): SeizeConnectContextType => ({ - address: connectedAddress, + address: impersonatedAddress ?? connectedAddress, walletName: walletInfo?.name, walletIcon: walletInfo?.icon, isSafeWallet: isSafeWalletInfo(walletInfo), @@ -593,8 +615,8 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({ seizeDisconnectAndLogout, seizeAcceptConnection, seizeConnectOpen: state.open, - isConnected: account.isConnected, - isAuthenticated: !!connectedAddress, + isConnected: impersonatedAddress ? true : account.isConnected, + isAuthenticated: !!(impersonatedAddress ?? connectedAddress), connectionState: walletState.status, // Unified state machine walletState, // Expose unified state for advanced consumers hasInitializationError, @@ -602,6 +624,7 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({ }), [ connectedAddress, + impersonatedAddress, walletInfo?.name, walletInfo?.icon, walletInfo?.type, diff --git a/components/common/RecipientSelector.tsx b/components/common/RecipientSelector.tsx index 90617eb4c1..1857905d31 100644 --- a/components/common/RecipientSelector.tsx +++ b/components/common/RecipientSelector.tsx @@ -41,21 +41,27 @@ function RecipientSelectedDisplay({ profile, isIdentityLoading, onClear, + allowProfileChange, + showSelectedProfileCard, walletsListRef, walletsHasOverflow, walletsAtEnd, selectedWallet, onWalletSelect, + disableSingleWalletSelection, }: { readonly selectedProfile: CommunityMemberMinimal; readonly profile: ApiIdentity | null; readonly isIdentityLoading: boolean; readonly onClear: () => void; + readonly allowProfileChange: boolean; + readonly showSelectedProfileCard: boolean; readonly walletsListRef: React.RefObject; readonly walletsHasOverflow: boolean; readonly walletsAtEnd: boolean; readonly selectedWallet: string | null; readonly onWalletSelect: (wallet: string) => void; + readonly disableSingleWalletSelection: boolean; }) { const getWallets = () => { if (profile?.wallets && profile.wallets.length > 0) { @@ -89,23 +95,42 @@ function RecipientSelectedDisplay({
); } else { + const hasSingleWallet = wallets.length === 1; + const isWalletSelectionDisabled = + disableSingleWalletSelection && hasSingleWallet; + walletsContent = wallets.map( (w: { wallet: string; display: string | null; tdh: number }) => { const isSel = selectedWallet?.toLowerCase() === w.wallet.toLowerCase(); const hasDisplay = w.display && w.display.toLowerCase() !== w.wallet.toLowerCase(); + const classes = [ + "tw-flex tw-min-h-[58px] tw-w-full tw-flex-col tw-rounded-lg tw-border tw-border-white/10 tw-bg-white/10 tw-p-2", + hasDisplay + ? "tw-items-start tw-justify-between" + : "tw-items-start tw-justify-center", + isSel ? "tw-border-2 tw-border-solid !tw-border-emerald-400" : "", + ].join(" "); + + if (isWalletSelectionDisabled) { + return ( +
+
+ {w.display || w.wallet} +
+ {hasDisplay && ( +
{w.wallet}
+ )} +
+ ); + } + return ( + )} - - + )} -
- {wallets.length > 1 && ( +
+ {(showSelectedProfileCard ? wallets.length > 1 : wallets.length > 0) && (
Choose destination wallet
)}
) : ( (false); - const [selectedProfile, setSelectedProfile] = + const [selectedFrenProfile, setSelectedFrenProfile] = useState(null); - const [selectedWallet, setSelectedWallet] = useState(null); + const [selectedFrenWallet, setSelectedFrenWallet] = useState( + null + ); + const [selectedMintForMeWallet, setSelectedMintForMeWallet] = useState< + string | null + >(null); + + const connectedRecipientProfile = useMemo(() => { + if (!account.address) { + return null; + } - function reset() { - setSelectedProfile(null); - setSelectedWallet(null); + return { + profile_id: connectedProfile?.id ?? null, + handle: connectedProfile?.handle ?? null, + normalised_handle: connectedProfile?.normalised_handle ?? null, + primary_wallet: connectedProfile?.primary_wallet ?? account.address, + display: connectedProfile?.display ?? account.address, + tdh: connectedProfile?.tdh ?? 0, + level: connectedProfile?.level ?? 0, + cic_rating: connectedProfile?.cic ?? 0, + wallet: account.address, + pfp: connectedProfile?.pfp ?? null, + }; + }, [connectedProfile, account.address]); + + function resetFren() { + setSelectedFrenProfile(null); + setSelectedFrenWallet(null); } useEffect(() => { - reset(); + resetFren(); setMintForFren(false); }, [account.address]); useEffect(() => { - if (mintForFren && selectedWallet) { - props.onMintFor(selectedWallet); + if (!account.address || mintForFren) { + return; + } + setSelectedMintForMeWallet(account.address); + }, [account.address, mintForFren]); + + useEffect(() => { + if (mintForFren && selectedFrenWallet) { + props.onMintFor(selectedFrenWallet); } else { - props.onMintFor(account.address as string); + props.onMintFor( + (selectedMintForMeWallet ?? account.address) as string + ); } - }, [selectedWallet, mintForFren, account.address, props]); + }, [ + selectedFrenWallet, + selectedMintForMeWallet, + mintForFren, + account.address, + props, + ]); - function printMintFor() { + function printMintForFren() { return (
@@ -64,6 +101,31 @@ export default function ManifoldMintingConnect( ); } + function printMintForMe() { + if (!connectedRecipientProfile) { + return <>; + } + + const noopProfileSelection = (_: CommunityMemberMinimal | null) => + undefined; + + return ( +
+ +
+ ); + } + function printConnected() { const profileHandle = connectedProfile?.handle ?? connectedProfile?.display ?? account.address; @@ -71,26 +133,33 @@ export default function ManifoldMintingConnect( return (
Connected Profile - - + - - {profileHandle} +
+
+ {profileHandle} +
+
+ TDH: {(connectedProfile?.tdh ?? 0).toLocaleString()} - Level:{" "} + {connectedProfile?.level ?? 0} +
{showAddress && ( - +
{account.address} - +
)} -
- +
+
); } function printContent() { - return <>{mintForFren && printMintFor()}; + return <>{mintForFren ? printMintForFren() : printMintForMe()}; } if (isIos) { @@ -129,7 +198,7 @@ export default function ManifoldMintingConnect( className={`btn ${mintForFren ? "btn-dark" : "btn-light"}`} style={{ width: "50%" }} onClick={() => { - reset(); + resetFren(); setMintForFren(false); }}> Mint for me From b621c1d998d6d5a0b48edc6782b715f20bf7b86e Mon Sep 17 00:00:00 2001 From: prxt6529 Date: Wed, 11 Feb 2026 12:51:44 +0200 Subject: [PATCH 2/7] WIP Signed-off-by: prxt6529 --- components/auth/SeizeConnectContext.tsx | 7 +++++ .../ManifoldMintingConnect.tsx | 30 +++++++++++-------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/components/auth/SeizeConnectContext.tsx b/components/auth/SeizeConnectContext.tsx index e21cdcabec..c303afe8e6 100644 --- a/components/auth/SeizeConnectContext.tsx +++ b/components/auth/SeizeConnectContext.tsx @@ -368,8 +368,15 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({ const nodeEnv = getNodeEnv(); const isDevLikeEnv = nodeEnv === "development" || nodeEnv === "test" || nodeEnv === "local"; + const isLocalHost = + typeof window !== "undefined" && + (window.location.hostname === "localhost" || + window.location.hostname === "127.0.0.1" || + window.location.hostname === "::1" || + window.location.hostname.endsWith(".local")); const impersonatedAddress = isDevLikeEnv && + isLocalHost && publicEnv.USE_DEV_AUTH === "true" && publicEnv.DEV_MODE_WALLET_ADDRESS && isAddress(publicEnv.DEV_MODE_WALLET_ADDRESS) diff --git a/components/manifoldMinting/ManifoldMintingConnect.tsx b/components/manifoldMinting/ManifoldMintingConnect.tsx index 275e37efea..84e0757e78 100644 --- a/components/manifoldMinting/ManifoldMintingConnect.tsx +++ b/components/manifoldMinting/ManifoldMintingConnect.tsx @@ -4,7 +4,7 @@ import type { CommunityMemberMinimal } from "@/entities/IProfile"; import { areEqualAddresses } from "@/helpers/Helpers"; import useCapacitor from "@/hooks/useCapacitor"; import Link from "next/link"; -import { useContext, useEffect, useMemo, useState } from "react"; +import { useCallback, useContext, useEffect, useMemo, useState } from "react"; import { Col, Container, Row } from "react-bootstrap"; import { AuthContext } from "../auth/Auth"; import { useSeizeConnectContext } from "../auth/SeizeConnectContext"; @@ -13,11 +13,14 @@ import { useCookieConsent } from "../cookies/CookieConsentContext"; import HeaderUserConnect from "../header/user/HeaderUserConnect"; import TransferModalPfp from "../nft-transfer/TransferModalPfp"; +const noopProfileSelection = (_: CommunityMemberMinimal | null) => undefined; + export default function ManifoldMintingConnect( props: Readonly<{ onMintFor: (address: string) => void; }> ) { + const { onMintFor } = props; const account = useSeizeConnectContext(); const { connectedProfile } = useContext(AuthContext); const { isIos } = useCapacitor(); @@ -52,15 +55,15 @@ export default function ManifoldMintingConnect( }; }, [connectedProfile, account.address]); - function resetFren() { + const resetFren = useCallback(() => { setSelectedFrenProfile(null); setSelectedFrenWallet(null); - } + }, []); useEffect(() => { resetFren(); setMintForFren(false); - }, [account.address]); + }, [account.address, resetFren]); useEffect(() => { if (!account.address || mintForFren) { @@ -71,18 +74,22 @@ export default function ManifoldMintingConnect( useEffect(() => { if (mintForFren && selectedFrenWallet) { - props.onMintFor(selectedFrenWallet); - } else { - props.onMintFor( - (selectedMintForMeWallet ?? account.address) as string - ); + onMintFor(selectedFrenWallet); + return; } + + const mintDestination = selectedMintForMeWallet ?? account.address; + if (!mintDestination) { + return; + } + + onMintFor(mintDestination); }, [ selectedFrenWallet, selectedMintForMeWallet, mintForFren, account.address, - props, + onMintFor, ]); function printMintForFren() { @@ -106,9 +113,6 @@ export default function ManifoldMintingConnect( return <>; } - const noopProfileSelection = (_: CommunityMemberMinimal | null) => - undefined; - return (
Date: Wed, 11 Feb 2026 13:18:46 +0200 Subject: [PATCH 3/7] WIP Signed-off-by: prxt6529 --- components/manifoldMinting/ManifoldMintingConnect.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/manifoldMinting/ManifoldMintingConnect.tsx b/components/manifoldMinting/ManifoldMintingConnect.tsx index 84e0757e78..42876b1a8d 100644 --- a/components/manifoldMinting/ManifoldMintingConnect.tsx +++ b/components/manifoldMinting/ManifoldMintingConnect.tsx @@ -73,7 +73,12 @@ export default function ManifoldMintingConnect( }, [account.address, mintForFren]); useEffect(() => { - if (mintForFren && selectedFrenWallet) { + if (mintForFren) { + if (!selectedFrenWallet) { + onMintFor(""); + return; + } + onMintFor(selectedFrenWallet); return; } From fcd25958ab0d97bab22a2e0a88e6a79ae43f49c6 Mon Sep 17 00:00:00 2001 From: prxt6529 Date: Wed, 11 Feb 2026 15:05:30 +0200 Subject: [PATCH 4/7] WIP Signed-off-by: prxt6529 --- .../manifoldMinting/ManifoldMintingWidget.tsx | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/components/manifoldMinting/ManifoldMintingWidget.tsx b/components/manifoldMinting/ManifoldMintingWidget.tsx index eba9572e1c..7f22792b88 100644 --- a/components/manifoldMinting/ManifoldMintingWidget.tsx +++ b/components/manifoldMinting/ManifoldMintingWidget.tsx @@ -9,6 +9,7 @@ import { import { Time } from "@/helpers/time"; import type { ManifoldClaim } from "@/hooks/useManifoldClaim"; import { ManifoldClaimStatus, ManifoldPhase } from "@/hooks/useManifoldClaim"; +import { useSearchParams } from "next/navigation"; import { useEffect, useState, type JSX } from "react"; import { Col, Container, Form, Row, Table } from "react-bootstrap"; import { @@ -35,7 +36,9 @@ export default function ManifoldMintingWidget( }> ) { const connectedAddress = useSeizeConnectContext(); + const searchParams = useSearchParams(); const [mintForAddress, setMintForAddress] = useState(""); + const [copyStatus, setCopyStatus] = useState<"" | "copied" | "failed">(""); const [isError, setIsError] = useState(false); const [fetchingMerkle, setFetchingMerkle] = useState(false); @@ -195,6 +198,59 @@ export default function ManifoldMintingWidget( } }; + const isMintDebugEnabled = searchParams?.get("mintdebug") === "1"; + + const buildMintDiagnostics = () => { + const connectedWallet = connectedAddress.address ?? ""; + const recipientWallet = mintForAddress; + const isProxy = + !!connectedWallet && + !!recipientWallet && + !areEqualAddresses(connectedWallet, recipientWallet); + const selectedProofs = getSelectedMerkleProofs(); + const argsPreview = + recipientWallet && mintCount > 0 + ? getMintArgs() + : { + functionName: "n/a", + args: [], + }; + + return { + timestamp: new Date().toISOString(), + chainId: MANIFOLD_NETWORK.id, + claimStatus: props.claim.status, + phase: props.claim.phase, + connectedWallet, + recipientWallet, + isProxy, + mintFunction: argsPreview.functionName, + mintCount, + valueWei: getValue().toString(), + feeWei: fee.toString(), + claimCostWei: props.claim.cost.toString(), + availableMerkleProofs: merkleProofs.length, + selectedMerkleProofs: selectedProofs.length, + mintedProofs: merkleProofsMints.filter(Boolean).length, + mintError: mintError || null, + txHash: mintWrite.data ?? null, + txPending: waitMintWritePending, + txSuccess: waitMintWriteSuccess, + }; + }; + + const onCopyMintDiagnostics = async () => { + try { + const diagnostics = buildMintDiagnostics(); + await navigator.clipboard.writeText(JSON.stringify(diagnostics, null, 2)); + setCopyStatus("copied"); + } catch { + setCopyStatus("failed"); + } finally { + setTimeout(() => setCopyStatus(""), 2000); + } + }; + const onMint = () => { setMintError(""); setMintStatus(<>); @@ -481,6 +537,47 @@ export default function ManifoldMintingWidget( ); } + function printMintDebug() { + if (!isMintDebugEnabled) { + return <>; + } + + const diagnostics = buildMintDiagnostics(); + + return ( + + +
+
+ Mint diagnostics + +
+
+              {JSON.stringify(diagnostics, null, 2)}
+            
+
+ +
+ ); + } + useEffect(() => { props.setMintForAddress(mintForAddress); }, [mintForAddress]); @@ -498,6 +595,7 @@ export default function ManifoldMintingWidget( {printContent()} + {printMintDebug()} ); } From ac64c43b4ccec7a26009183fdd5edb4fde668488 Mon Sep 17 00:00:00 2001 From: prxt6529 Date: Wed, 11 Feb 2026 15:38:45 +0200 Subject: [PATCH 5/7] WIP Signed-off-by: prxt6529 --- components/auth/SeizeConnectContext.tsx | 10 +++--- .../manifoldMinting/ManifoldMintingWidget.tsx | 32 ++++++++++++------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/components/auth/SeizeConnectContext.tsx b/components/auth/SeizeConnectContext.tsx index c303afe8e6..c674bed7f6 100644 --- a/components/auth/SeizeConnectContext.tsx +++ b/components/auth/SeizeConnectContext.tsx @@ -369,11 +369,11 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({ const isDevLikeEnv = nodeEnv === "development" || nodeEnv === "test" || nodeEnv === "local"; const isLocalHost = - typeof window !== "undefined" && - (window.location.hostname === "localhost" || - window.location.hostname === "127.0.0.1" || - window.location.hostname === "::1" || - window.location.hostname.endsWith(".local")); + typeof globalThis.window !== "undefined" && + (globalThis.window.location.hostname === "localhost" || + globalThis.window.location.hostname === "127.0.0.1" || + globalThis.window.location.hostname === "::1" || + globalThis.window.location.hostname.endsWith(".local")); const impersonatedAddress = isDevLikeEnv && isLocalHost && diff --git a/components/manifoldMinting/ManifoldMintingWidget.tsx b/components/manifoldMinting/ManifoldMintingWidget.tsx index 7f22792b88..92cf060d5b 100644 --- a/components/manifoldMinting/ManifoldMintingWidget.tsx +++ b/components/manifoldMinting/ManifoldMintingWidget.tsx @@ -543,6 +543,24 @@ export default function ManifoldMintingWidget( } const diagnostics = buildMintDiagnostics(); + const getCopyButtonStyle = () => { + if (copyStatus === "copied") { + return "tw-border-emerald-400/60 tw-bg-emerald-500/20"; + } + if (copyStatus === "failed") { + return "tw-border-red-400/60 tw-bg-red-500/20"; + } + return "tw-border-white/20 tw-bg-white/10 hover:tw-bg-white/15"; + }; + const getCopyButtonText = () => { + if (copyStatus === "copied") { + return "Copied!"; + } + if (copyStatus === "failed") { + return "Copy Failed"; + } + return "Copy"; + }; return ( @@ -554,19 +572,9 @@ export default function ManifoldMintingWidget( type="button" onClick={onCopyMintDiagnostics} disabled={copyStatus === "copied" || copyStatus === "failed"} - className={`tw-w-[170px] tw-rounded-md tw-border tw-px-2 tw-py-1 !tw-text-sm tw-font-medium tw-text-white disabled:tw-cursor-default ${ - copyStatus === "copied" - ? "tw-border-emerald-400/60 tw-bg-emerald-500/20" - : copyStatus === "failed" - ? "tw-border-red-400/60 tw-bg-red-500/20" - : "tw-border-white/20 tw-bg-white/10 hover:tw-bg-white/15" - }`} + className={`tw-w-[170px] tw-rounded-md tw-border tw-px-2 tw-py-1 !tw-text-sm tw-font-medium tw-text-white disabled:tw-cursor-default ${getCopyButtonStyle()}`} > - {copyStatus === "copied" - ? "Copied!" - : copyStatus === "failed" - ? "Copy Failed" - : "Copy"} + {getCopyButtonText()}

From 6fb44c09a9f0d1baa9c8c6b8687c341b4cbefc33 Mon Sep 17 00:00:00 2001
From: prxt6529 
Date: Wed, 11 Feb 2026 15:48:46 +0200
Subject: [PATCH 6/7] WIP

Signed-off-by: prxt6529 
---
 components/auth/SeizeConnectContext.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/auth/SeizeConnectContext.tsx b/components/auth/SeizeConnectContext.tsx
index c674bed7f6..840218c625 100644
--- a/components/auth/SeizeConnectContext.tsx
+++ b/components/auth/SeizeConnectContext.tsx
@@ -369,7 +369,7 @@ export const SeizeConnectProvider: React.FC<{ children: React.ReactNode }> = ({
   const isDevLikeEnv =
     nodeEnv === "development" || nodeEnv === "test" || nodeEnv === "local";
   const isLocalHost =
-    typeof globalThis.window !== "undefined" &&
+    globalThis.window !== undefined &&
     (globalThis.window.location.hostname === "localhost" ||
       globalThis.window.location.hostname === "127.0.0.1" ||
       globalThis.window.location.hostname === "::1" ||

From 3c3987352007123d1b590acc46118ae45d55b923 Mon Sep 17 00:00:00 2001
From: prxt6529 
Date: Wed, 11 Feb 2026 17:30:10 +0200
Subject: [PATCH 7/7] WIP

Signed-off-by: prxt6529 
---
 .../manifoldMinting/ManifoldMintingWidget.tsx     | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/components/manifoldMinting/ManifoldMintingWidget.tsx b/components/manifoldMinting/ManifoldMintingWidget.tsx
index 92cf060d5b..6136b68b1c 100644
--- a/components/manifoldMinting/ManifoldMintingWidget.tsx
+++ b/components/manifoldMinting/ManifoldMintingWidget.tsx
@@ -135,8 +135,12 @@ export default function ManifoldMintingWidget(
   const getSelectedMerkleProofs = () => {
     const selectedMerkleProofs: ManifoldMerkleProof[] = [];
     for (let i = 0; i < merkleProofsMints.length; i++) {
+      const proof = merkleProofs[i];
+      if (!proof) {
+        continue;
+      }
       if (!merkleProofsMints[i]) {
-        selectedMerkleProofs.push(merkleProofs[i]!);
+        selectedMerkleProofs.push(proof);
       }
       if (selectedMerkleProofs.length === mintCount) {
         break;
@@ -254,6 +258,15 @@ export default function ManifoldMintingWidget(
   const onMint = () => {
     setMintError("");
     setMintStatus(<>);
+
+    if (props.claim.phase === ManifoldPhase.ALLOWLIST) {
+      const selectedProofs = getSelectedMerkleProofs();
+      if (selectedProofs.length < mintCount) {
+        setMintError("No allowlist spots in current phase for this address");
+        return;
+      }
+    }
+
     const value = getValue();
     const args = getMintArgs();
     mintWrite.writeContract({