- {isLoading ?
:
Error loading data
}
+
+
+ {isLoading ? (
+
+ ) : (
+
+
+
Error loading data
+
+ Something went wrong while fetching the data. Please try again later.
+
+
+ )}
)
diff --git a/rooch-portal-v1/src/pages/assets/assets-details/tabs/nft/assets-nft.tsx b/rooch-portal-v1/src/pages/assets/assets-details/tabs/nft/assets-nft.tsx
index 208f6369b5..384e5fdeb9 100644
--- a/rooch-portal-v1/src/pages/assets/assets-details/tabs/nft/assets-nft.tsx
+++ b/rooch-portal-v1/src/pages/assets/assets-details/tabs/nft/assets-nft.tsx
@@ -8,7 +8,7 @@ import {
useTransferObject,
} from '@roochnetwork/rooch-sdk-kit'
-import { ArrowLeft, Copy } from 'lucide-react'
+import { AlertCircle, ArrowLeft, Copy } from 'lucide-react'
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
import { Input } from '@/components/ui/input'
@@ -174,9 +174,19 @@ export const AssetsNft = () => {
if (isLoading || isError) {
return (
-
-
- {isLoading ?
:
Error loading data
}
+
+
+ {isLoading ? (
+
+ ) : (
+
+
+
Error loading data
+
+ Something went wrong while fetching the data. Please try again later.
+
+
+ )}
)
diff --git a/rooch-portal-v1/src/pages/settings/components/connected-account.tsx b/rooch-portal-v1/src/pages/settings/components/connected-account.tsx
index f5ba909c63..eab2111d24 100644
--- a/rooch-portal-v1/src/pages/settings/components/connected-account.tsx
+++ b/rooch-portal-v1/src/pages/settings/components/connected-account.tsx
@@ -11,7 +11,7 @@ import {
TableHeader,
TableRow,
} from '@/components/ui/table'
-import { Copy, Check } from 'lucide-react'
+import { Copy, Check, CircleUser } from 'lucide-react'
import { formatAddress } from '@/utils/format.ts'
import { useCurrentAccount } from '@roochnetwork/rooch-sdk-kit'
import toast from 'react-hot-toast'
@@ -41,6 +41,24 @@ export const ConnectedAccount = () => {
})
}
+ if (!account) {
+ return (
+
+
+ {account ? (
+
+ ) : (
+
+
+
Could not find your account
+
Please connect to wallet.
+
+ )}
+
+
+ )
+ }
+
return (
diff --git a/rooch-portal-v1/src/pages/settings/components/manage-sessions.tsx b/rooch-portal-v1/src/pages/settings/components/manage-sessions.tsx
index 7719596024..ab48a3826a 100644
--- a/rooch-portal-v1/src/pages/settings/components/manage-sessions.tsx
+++ b/rooch-portal-v1/src/pages/settings/components/manage-sessions.tsx
@@ -1,5 +1,6 @@
// Copyright (c) RoochNetwork
// SPDX-License-Identifier: Apache-2.0
+import { useState } from 'react'
import {
Table,
TableBody,
@@ -10,13 +11,12 @@ import {
TableRow,
} from '@/components/ui/table'
import { Button } from '@/components/ui/button'
-import { useState } from 'react'
import {
useCurrentSession,
useRemoveSession,
useRoochClientQuery,
} from '@roochnetwork/rooch-sdk-kit'
-import { Copy, ChevronDown, ChevronUp, Check } from 'lucide-react'
+import { Copy, ChevronDown, ChevronUp, Check, AlertCircle } from 'lucide-react'
interface Session {
authenticationKey: string
@@ -60,7 +60,11 @@ const copyToClipboard = async (text: string, setCopied: (value: boolean) => void
export const ManageSessions: React.FC = () => {
const sessionKey = useCurrentSession()
const { mutateAsync: removeSession } = useRemoveSession()
- const { data: sessionKeys } = useRoochClientQuery('querySessionKeys', {
+ const {
+ data: sessionKeys,
+ isLoading,
+ isError,
+ } = useRoochClientQuery('querySessionKeys', {
address: sessionKey?.getAddress() || '',
})
@@ -78,6 +82,40 @@ export const ManageSessions: React.FC = () => {
maxInactiveInterval: session.maxInactiveInterval.toString(),
})
+ if (isLoading || isError) {
+ return (
+
+
+ {isLoading ? (
+
+ ) : (
+
+
+
Error loading data
+
+ Something went wrong while fetching the data. Please try again later.
+
+
+ )}
+
+
+ )
+ }
+
+ if (!sessionKeys?.data.length) {
+ return (
+
+
+
+
No Data
+
+ No session keys found. Please check again later.
+
+
+
+ )
+ }
+
return (
@@ -93,7 +131,7 @@ export const ManageSessions: React.FC = () => {
- {sessionKeys?.data.map((session: SessionInfoResult) => (
+ {sessionKeys.data.map((session: SessionInfoResult) => (