From b1ef502e9570247583ee60a78aede195b5abaf94 Mon Sep 17 00:00:00 2001 From: Franck Date: Wed, 22 Dec 2021 15:42:05 +1100 Subject: [PATCH] Set default poll duration to one week --- .../poll-react-components/src/components/PollCreation.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/poll-react-components/src/components/PollCreation.tsx b/packages/poll-react-components/src/components/PollCreation.tsx index b7bda20..35c7ce0 100644 --- a/packages/poll-react-components/src/components/PollCreation.tsx +++ b/packages/poll-react-components/src/components/PollCreation.tsx @@ -5,6 +5,8 @@ import { WakuPolling } from '@dappconnect/vote-poll-sdk-core' import { Input, addIcon, SmallButton, Modal, Theme } from '@dappconnect/vote-poll-sdk-react-components' import { MESSAGE_SENDING_RESULT } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/classes/WakuPolling' +const defaultPollDuration = 7 * 24 * 60 * 60 * 1000 // One week in ms. + function getLocaleIsoTime(dateTime: Date) { const MS_PER_MINUTE = 60000 const milliseconds = dateTime.getTime() - dateTime.getTimezoneOffset() * MS_PER_MINUTE @@ -45,7 +47,7 @@ export function PollCreation({ wakuPolling, theme, setShowPollCreation }: PollCr const [showCreateConfirmation, setShowCreateConfirmation] = useState(false) const [showNotEnoughTokens, setShowNotEnoughTokens] = useState(false) const [selectedType, setSelectedType] = useState(PollType.NON_WEIGHTED) - const [endTimePicker, setEndTimePicker] = useState(new Date(new Date().getTime() + 10000000)) + const [endTimePicker, setEndTimePicker] = useState(new Date(new Date().getTime() + defaultPollDuration)) return (