Skip to content

Commit

Permalink
Hotfix for looped draft saver;
Browse files Browse the repository at this point in the history
  • Loading branch information
stef-coenen committed Jan 30, 2025
1 parent 708f497 commit f0aa631
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ export const DraftSaver = ({
)
return;

const emptiedDraft = isEmptyRichText(message) ? undefined : message;
if (drafts[draftKey]?.message === undefined && emptiedDraft === undefined) return;

const newDrafts: Record<string, Draft | undefined> = {
...drafts,
[draftKey]: {
message: isEmptyRichText(message) ? undefined : message,
message: emptiedDraft,
updatedAt: updatedAt || 0,
},
};
Expand Down

0 comments on commit f0aa631

Please sign in to comment.