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
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:
parent
2e07477398
commit
def1e6396c
1 changed files with 2 additions and 10 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue