diff --git a/ui/app/(marketing)/docs/page.tsx b/ui/app/(marketing)/docs/page.tsx index 01ae400..56a38c6 100644 --- a/ui/app/(marketing)/docs/page.tsx +++ b/ui/app/(marketing)/docs/page.tsx @@ -641,7 +641,6 @@ Content-Type: application/json
  • Subaddress index shown on each invoice
  • Wallet lookahead controls discovery
  • Subaddresses cycle through indices 1 to 100
  • -
  • Set a start index to shift the range to start + 1 through 100
  • Wallets may require adding the index to view funds
  • diff --git a/ui/components/btcpay-checkout-style-section.tsx b/ui/components/btcpay-checkout-style-section.tsx index 32a973d..e5a0b91 100644 --- a/ui/components/btcpay-checkout-style-section.tsx +++ b/ui/components/btcpay-checkout-style-section.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; import { useFormState } from "react-dom"; +import { useRouter } from "next/navigation"; import { updateBtcpayCheckoutStyleAction, @@ -25,23 +26,30 @@ const initialState = ( export default function BtcpayCheckoutStyleSection({ initialStyle, }: BtcpayCheckoutStyleSectionProps) { + const router = useRouter(); const [state, formAction] = useFormState( updateBtcpayCheckoutStyleAction, initialState(initialStyle) ); - const [style, setStyle] = useState(state.style); + const [style, setStyle] = useState(initialStyle); useEffect(() => { - setStyle(state.style); - }, [state.style]); + if (state.success) { + router.refresh(); + } + }, [router, state.success]); + + useEffect(() => { + setStyle(initialStyle); + }, [initialStyle]); return (

    BTCPay checkout layout

    - Choose the hosted invoice layout shown to payers when you use the BTCPay - compatibility endpoints. + This setting only applies to BTCPay checkouts (invoices created via the + BTCPay compatibility endpoints).