Don't allow a duration that exceeds Feb 8th
> _Max date it can do is back to : 2022-02-08 - so don't allow a days value that's higher than this. (hint before selection / submission if possible)_ My initial understanding was that it is ok to set beyond this date (e.g. "1 year"), just that any channels created before Feb 7 will still be able to comment even if they are less than a year old. That feels like ok behavior to me (easier for user to grasp), but turns out setting anything before that date will block all channels. So, this commit changes the warning message and also blocks the user from finalizing.
This commit is contained in:
parent
2e26064d2f
commit
51d4407002
2 changed files with 3 additions and 3 deletions
|
@ -2201,7 +2201,7 @@
|
|||
"Minimum channel age for comments": "Minimum channel age for comments",
|
||||
"Channels with a lifespan lower than the specified duration will not be able to comment on your content.": "Channels with a lifespan lower than the specified duration will not be able to comment on your content.",
|
||||
"Set minimum channel age": "Set minimum channel age",
|
||||
"Note that the restriction can only be applied to channels created after Feb 8th, 2022.": "Note that the restriction can only be applied to channels created after Feb 8th, 2022.",
|
||||
"The minimum duration must not exceed Feb 8th, 2022.": "The minimum duration must not exceed Feb 8th, 2022.",
|
||||
"No limit": "No limit",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import FormFieldDuration from 'component/formFieldDuration';
|
|||
import { Modal } from 'modal/modal';
|
||||
|
||||
const CHANNEL_AGE_LIMIT_MIN_DATE = new Date('February 8, 2022 00:00:00');
|
||||
const LIMITATION_WARNING = 'Note that the restriction can only be applied to channels created after Feb 8th, 2022.';
|
||||
const LIMITATION_WARNING = 'The minimum duration must not exceed Feb 8th, 2022.';
|
||||
|
||||
type Props = {
|
||||
onConfirm: (limitInMinutes: number, closeModal: () => void) => void,
|
||||
|
@ -22,7 +22,7 @@ export default function ModalMinChannelAge(props: Props) {
|
|||
const [limitDisabled, setLimitDisabled] = React.useState(false);
|
||||
const [minChannelAgeInput, setMinChannelAgeInput] = React.useState('');
|
||||
const [minChannelAgeMinutes, setMinChannelAgeMinutes] = React.useState(-1);
|
||||
const inputOk = limitDisabled || minChannelAgeMinutes > 0;
|
||||
const inputOk = limitDisabled || (minChannelAgeMinutes > 0 && !showLimitationWarning);
|
||||
|
||||
function handleOnClick() {
|
||||
if (onConfirm) {
|
||||
|
|
Loading…
Reference in a new issue