Skip to content

Commit f5602ab

Browse files
committed
Remove existing document from view if initial content load fails
1 parent 54eb695 commit f5602ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/src/pages/DocPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export default function DocPage() {
114114
)
115115
} catch (error) {
116116
console.error('Error fetching document:', error)
117+
setDoc(null)
117118
setError('Failed to load document. Please try again later.')
118119
} finally {
119120
setLoading(false)
@@ -170,7 +171,7 @@ export default function DocPage() {
170171
}
171172
return (
172173
<>
173-
{error && <div className="alert alert-error m-4">{error}</div>}
174+
{error && <div className="alert alert-error mt-6 max-w-100 self-center">{error}</div>}
174175
{doc && (
175176
<div className="flex h-full items-start justify-center">
176177
<div className="mx-0 flex min-h-full w-full max-w-200 grow flex-col p-4 sm:mx-2 md:mx-4 lg:mx-8">

0 commit comments

Comments
 (0)