From def1e6396c6b6b8e70ccf5b8155a55a13af85ac9 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sun, 2 Oct 2022 16:13:37 +0200 Subject: [PATCH] fixup: simplify check because there is never an initial poll --- packages/client/src/components/post-form.vue | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/client/src/components/post-form.vue b/packages/client/src/components/post-form.vue index 8821641f6..8f1b78211 100644 --- a/packages/client/src/components/post-form.vue +++ b/packages/client/src/components/post-form.vue @@ -511,7 +511,6 @@ const initialDraftData = JSON.parse(JSON.stringify({ visibility, localOnly, files, - poll, })); function saveDraft() { @@ -525,15 +524,8 @@ function saveDraft() { && initialDraftData.visibility === visibility && initialDraftData.localOnly === localOnly && initialDraftData.files.each((file, i) => file.id === files[i].id) - && ( - (initialDraftData.poll == null && poll == null) - || ( - initialDraftData.poll.choices.each((choice, i) => choice === choices[i]) - && initialDraftData.poll.multiple === poll.multiple - && initialDraftData.poll.expiresAt === poll.expiresAt - && initialDraftData.poll.expiredAfter === poll.expiredAfter - ) - ) + // initial state is always poll == null + && poll == null ) { // This is the same as the initial draft data, no need to save it. // If it was saved before, delete it.