mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 23:47:12 +02:00
fix(post): preserve content when signing or publishing
Critical fix: Don't clear editor content until publish succeeds. **The Problem:** - RichEditor automatically cleared content on submit - Content was wiped immediately when clicking "Publish" - User lost their content before knowing if publish succeeded **The Solution:** - Remove automatic `clearContent()` from RichEditor's handleSubmit - Let PostViewer control when to clear the editor - Only clear editor after successful publish (successCount > 0) **User Experience Now:** - Click "Publish" → content stays visible while publishing - Publishing succeeds → content clears, show preview - Publishing fails → content stays, user can edit and retry - User rejects signing → content stays, can try again No more losing your post to a rejected signature or failed publish!
This commit is contained in:
@@ -503,6 +503,9 @@ export function PostViewer({ windowId }: PostViewerProps = {}) {
|
||||
localStorage.removeItem(draftKey);
|
||||
}
|
||||
|
||||
// Clear editor content
|
||||
editorRef.current?.clear();
|
||||
|
||||
// Show published preview
|
||||
setShowPublishedPreview(true);
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ export const RichEditor = forwardRef<RichEditorHandle, RichEditorProps>(
|
||||
serialized.eventRefs,
|
||||
serialized.addressRefs,
|
||||
);
|
||||
editorInstance.commands.clearContent();
|
||||
// Don't clear content here - let the parent component decide when to clear
|
||||
}
|
||||
},
|
||||
[onSubmit],
|
||||
|
||||
Reference in New Issue
Block a user