mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-20 21:18:13 +02:00
- Reduced maximum document size for the editor from 5MB to 1MB. - Introduced a new line limit of 5000 for documents in the editor. - Implemented a PlateErrorBoundary component to handle rendering errors gracefully in the editor panel. - Updated logic in the editor panel to check both size and line count for document limits.
34 lines
625 B
TypeScript
34 lines
625 B
TypeScript
"use client";
|
|
|
|
import { Component, type ReactNode } from "react";
|
|
|
|
interface PlateErrorBoundaryProps {
|
|
children: ReactNode;
|
|
fallback: ReactNode;
|
|
}
|
|
|
|
interface PlateErrorBoundaryState {
|
|
hasError: boolean;
|
|
}
|
|
|
|
export class PlateErrorBoundary extends Component<
|
|
PlateErrorBoundaryProps,
|
|
PlateErrorBoundaryState
|
|
> {
|
|
constructor(props: PlateErrorBoundaryProps) {
|
|
super(props);
|
|
this.state = { hasError: false };
|
|
}
|
|
|
|
static getDerivedStateFromError(): PlateErrorBoundaryState {
|
|
return { hasError: true };
|
|
}
|
|
|
|
render() {
|
|
if (this.state.hasError) {
|
|
return this.props.fallback;
|
|
}
|
|
|
|
return this.props.children;
|
|
}
|
|
}
|