UI: Fixed missing types
Some checks failed
checks-impure / test (pull_request) Successful in 25s
checks / test (pull_request) Failing after 2m2s

This commit is contained in:
2024-01-15 19:56:24 +01:00
parent 4918f84e85
commit 93084c360b
2 changed files with 15 additions and 8 deletions

View File

@@ -95,7 +95,7 @@ def create_service(idx: int, entity: Entity) -> ServiceCreate:
]
},
entity_did=entity.did,
usage=[],
usage=[{"times_consumed": 2, "consumer_entity_did": "did:sov:test:120"}],
)
return se

View File

@@ -1,22 +1,30 @@
import React from "react";
class ErrorBoundary extends React.Component {
constructor(props: any) {
interface Props {
children: React.ReactNode;
}
interface State {
hasError: boolean;
}
class ErrorBoundary extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
// Define a state variable to track whether is an error or not
this.state = { hasError: false };
}
static getDerivedStateFromError(error: any) {
static getDerivedStateFromError(error: Error): State {
// eslint-disable-line
// Update state so the next render will show the fallback UI
return { hasError: true };
}
componentDidCatch(error: any, errorInfo: any) {
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {
// You can use your own error logging service here
console.log({ error, errorInfo });
}
render() {
render(): React.ReactNode {
// Check if the error is thrown
if (this.state.hasError) {
// You can render any custom fallback UI
@@ -34,7 +42,6 @@ class ErrorBoundary extends React.Component {
}
// Return children components in case of no error
return this.props.children;
}
}