Skip to content

Commit 9a6c1db

Browse files
fix: loading state options
1 parent ccf8401 commit 9a6c1db

File tree

14 files changed

+247
-331
lines changed

14 files changed

+247
-331
lines changed

examples/nextjs-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@headlessui/react": "^2.2.0",
1515
"@rainbow-me/rainbowkit": "^2.2.8",
1616
"@rozoai/intent-common": "0.1.7",
17-
"@rozoai/intent-pay": "0.1.10",
17+
"@rozoai/intent-pay": "workspace:*",
1818
"@tanstack/react-query": "^5.51.11",
1919
"@types/react-syntax-highlighter": "^15.5.13",
2020
"@wagmi/core": "^2.22.0",

packages/connectkit/bundle-analysis.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/connectkit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@rozoai/intent-pay",
33
"private": false,
4-
"version": "0.1.10",
4+
"version": "0.1.12-beta.1",
55
"author": "RozoAI",
66
"homepage": "https://github.com/RozoAI/intent-pay",
77
"license": "BSD-2-Clause",
@@ -47,7 +47,7 @@
4747
"@albedo-link/intent": "^0.13.0",
4848
"@reown/appkit": "^1.7.0",
4949
"@rollup/plugin-typescript": "^12.1.2",
50-
"@rozoai/intent-common": "0.1.7",
50+
"@rozoai/intent-common": "0.1.8-beta.1",
5151
"@solana/spl-token": "^0.4.14",
5252
"@solana/wallet-adapter-base": "^0.9.27",
5353
"@solana/wallet-adapter-react": "^0.15.39",

packages/connectkit/src/components/Pages/SelectToken/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default function SelectToken() {
114114
show={effectiveTokenMode}
115115
excludeLogos={["stellar"]}
116116
/>
117-
{(optionsList.length > 0 || isLoading) && (
117+
{(!isEmptyOptionsList || isLoading) && (
118118
<OptionsList
119119
requiredSkeletons={3}
120120
isLoading={isLoading}
@@ -126,7 +126,7 @@ export default function SelectToken() {
126126
hideBottomLine={!isAnotherMethodButtonVisible}
127127
/>
128128
)}
129-
{isEmptyOptionsList && !noConnectedWallet && (
129+
{!isLoading && isEmptyOptionsList && !noConnectedWallet && (
130130
<NoTokensAvailable
131131
onRefresh={refreshOptions}
132132
preferredTokens={paymentState.payParams?.preferredTokens}

packages/connectkit/src/defaultConfig.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import { type CreateConfigParameters, CreateConnectorFn, http } from "wagmi";
22
import {
33
arbitrum,
4-
avalanche,
54
base,
65
bsc,
76
Chain,
8-
gnosis,
97
mainnet,
10-
optimism,
118
polygon,
129
worldchain,
1310
} from "wagmi/chains";
@@ -41,12 +38,12 @@ type DefaultConfigProps = {
4138
*/
4239
export const REQUIRED_CHAINS: CreateConfigParameters["chains"] = [
4340
arbitrum,
44-
avalanche,
41+
// avalanche,
4542
base,
4643
bsc,
47-
gnosis,
44+
// gnosis,
4845
mainnet,
49-
optimism,
46+
// optimism,
5047
polygon,
5148
worldchain,
5249
];

packages/connectkit/src/hooks/useSolanaPaymentOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function useSolanaPaymentOptions({
2424
payParams: PayParams | undefined;
2525
}) {
2626
const [options, setOptions] = useState<WalletPaymentOption[] | null>(null);
27-
const [isLoading, setIsLoading] = useState(false);
27+
const [isLoading, setIsLoading] = useState(true);
2828

2929
// Track the last executed parameters to prevent duplicate API calls
3030
const lastExecutedParams = useRef<string | null>(null);

packages/connectkit/src/hooks/useStellarPaymentOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function useStellarPaymentOptions({
3333
}, [chains]);
3434

3535
const [options, setOptions] = useState<WalletPaymentOption[] | null>(null);
36-
const [isLoading, setIsLoading] = useState(false);
36+
const [isLoading, setIsLoading] = useState(true);
3737

3838
// Track the last executed parameters to prevent duplicate API calls
3939
const lastExecutedParams = useRef<string | null>(null);

packages/connectkit/src/hooks/useTokenOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function useTokenOptions(mode: "evm" | "solana" | "stellar" | "all"): {
3535
const preferredTokens = paymentState.payParams?.preferredTokens;
3636

3737
const optionsList: Option[] = [];
38-
let isLoading = false;
38+
let isLoading = true;
3939
let hasAnyData = false;
4040

4141
// Determine which token types should be included based on mode and paymentOptions

packages/connectkit/src/hooks/useWalletPaymentOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function useWalletPaymentOptions({
4747
log: (msg: string) => void;
4848
}) {
4949
const [options, setOptions] = useState<WalletPaymentOption[] | null>(null);
50-
const [isLoading, setIsLoading] = useState(false);
50+
const [isLoading, setIsLoading] = useState(true);
5151

5252
// Track the last executed parameters to prevent duplicate API calls
5353
const lastExecutedParams = useRef<string | null>(null);

packages/connectkit/src/payment/paymentEffects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ async function runHydratePayIdEffects(
604604
value: BigInt("0"),
605605
data: "0x",
606606
},
607-
refundAddr: (order.refundAddr as `0x${string}`) || null,
607+
refundAddr: order.refundAddr || null,
608608
nonce: orderData.data.nonce as unknown as bigint,
609609
sourceTokenAmount: null,
610610
sourceFulfillerAddr: null,

0 commit comments

Comments
 (0)