forked from FoundKeyGang/FoundKey
fixup: simplify check because there is never an initial poll
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