From 2b63ef3e1a19e188915cb758b0cafa48eb67e154 Mon Sep 17 00:00:00 2001 From: Brandon Willett Date: Sun, 17 Jan 2021 18:56:58 -0500 Subject: [PATCH] small bugfix for editing note --- src/components/CardLarge.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/CardLarge.svelte b/src/components/CardLarge.svelte index 257e8a2..5507cd8 100644 --- a/src/components/CardLarge.svelte +++ b/src/components/CardLarge.svelte @@ -33,7 +33,9 @@ let secretKey = Cookie.get('awsSecretKey'); let client = documentClient(accessKey, secretKey); - let response = await updateSnippet(client, fullNote.created, editedTitle, editedContent, searchKeys); + let fixedTitle = editedTitle.length == 0 ? null : editedTitle; + + let response = await updateSnippet(client, fullNote.created, fixedTitle, editedContent, searchKeys); window.location.reload(); } catch (err) { @@ -45,7 +47,7 @@
{#if editing} - + {:else} {fullNote.title || "(no title)"} @@ -60,7 +62,7 @@
{#if editing} -