fixup: simplify check because there is never an initial poll
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed

This commit is contained in:
Johann150 2022-10-02 16:13:37 +02:00
parent 2e07477398
commit def1e6396c
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -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.