Clean up drafts implementation #164
Reference in New Issue
Block a user
Delete Branch "drafts-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@@ -43,4 +43,2 @@let {url, h, header, initialValues}: Props = $props()const draftKey = new DraftKey<CalendarValues>(`calendar:${url}:${h ?? ""}`)const draft = draftKey.get()No need to clutter things with one-off variables
@@ -32,2 +32,2 @@start: number | undefinedend: number | undefinedstart?: numberend?: numberIn my review I didn't realize that these had no default values, and so we have to accept optional/undefined.
@@ -129,1 +116,4 @@let endDirty = $state(Boolean(initialValues?.end))let content = $state(initialValues?.content ?? "")const onChange = (json: object) => {Avoid unknown; object isn't much better but it is marginally better.
@@ -51,4 +46,0 @@images?: (string | File)[]status?: stringtopics?: string[]}This is what I meant by creating the additional type, this allows us to name types but avoid duplicating the definitions.
@@ -148,7 +145,5 @@ export const makeEditor = async ({},});(ed as any)._shouldAutofocus = autofocusThis is a hack; we can just pass the thing straight to EditorCompose
@userAdityaa this PR is a follow up from #155, just a few things that I thought it would be easier to show rather than tell. Just take a look to get an idea of what I was going for.
Thanks for the review and the fixes! Noted the suggestions, will incorporate these improvements in future PRs.