Fix parseInt TypeScript error

This commit is contained in:
Dmitry Lyzo 2022-02-16 01:02:31 +03:00
parent 93b12cf74b
commit 61b6976d59

View File

@ -145,7 +145,7 @@ const UserParentalControl: FunctionComponent = () => {
for (const btnDelete of accessScheduleList.querySelectorAll('.btnDelete')) {
btnDelete.addEventListener('click', function () {
const index = parseInt(btnDelete.getAttribute('data-index'));
const index = parseInt(btnDelete.getAttribute('data-index') || '0', 10);
schedules.splice(index, 1);
const newindex = schedules.filter(function (i: number) {
return i != index;