Add a specific message when the marketplace is not enabled

This commit is contained in:
Arnaud 2024-10-07 23:09:53 +02:00
parent c8411eb96a
commit c5fd035b8d
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
4 changed files with 1872 additions and 1119 deletions

2945
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@
],
"dependencies": {
"@codex-storage/marketplace-ui-components": "0.0.14",
"@codex-storage/sdk-js": "0.0.6",
"@codex-storage/sdk-js": "0.0.7",
"@sentry/browser": "^8.32.0",
"@sentry/react": "^8.31.0",
"@tanstack/react-query": "^5.51.15",

View File

@ -8,6 +8,7 @@ import { CodexSdk } from "../../sdk/codex";
import "./availabilities.css";
import { AvailabilitiesTable } from "../../components/Availability/AvailabilitiesTable";
import { AvailabilityCreate } from "../../components/Availability/AvailabilityCreate";
import { CodexError } from "@codex-storage/sdk-js";
const defaultSpace = {
quotaMaxBytes: 0,
@ -105,9 +106,24 @@ export function Availabilities() {
export const Route = createFileRoute("/dashboard/availabilities")({
component: () => (
<ErrorBoundary
fallback={({ error }) => (
<ErrorPlaceholder error={error} subtitle="Cannot retrieve the data." />
)}>
fallback={({ error }) => {
console.info("error", error);
if (error instanceof CodexError && error.code === 503) {
return (
<ErrorPlaceholder
error={error}
subtitle="The marketplace is not enabled in your Node. Please restart you node with persistence argument, check the documentation for more details."
/>
);
}
return (
<ErrorPlaceholder
error={error}
subtitle="Cannot retrieve the data."
/>
);
}}>
<Availabilities />
</ErrorBoundary>
),

View File

@ -11,6 +11,7 @@ import { TruncateCell } from "../../components/TruncateCell/TruncateCell";
import { Times } from "../../utils/times";
import { ErrorPlaceholder } from "../../components/ErrorPlaceholder/ErrorPlaceholder";
import { ErrorBoundary } from "@sentry/react";
import { CodexError } from "@codex-storage/sdk-js";
const Purchases = () => {
const { data, isPending, error } = useQuery({
@ -85,9 +86,24 @@ const Purchases = () => {
export const Route = createFileRoute("/dashboard/purchases")({
component: () => (
<ErrorBoundary
fallback={({ error }) => (
<ErrorPlaceholder error={error} subtitle="Cannot retrieve the data." />
)}>
fallback={({ error }) => {
console.info("error", error);
if (error instanceof CodexError && error.code === 503) {
return (
<ErrorPlaceholder
error={error}
subtitle="The marketplace is not enabled in your Node. Please restart you node with persistence argument, check the documentation for more details."
/>
);
}
return (
<ErrorPlaceholder
error={error}
subtitle="Cannot retrieve the data."
/>
);
}}>
<Purchases />
</ErrorBoundary>
),