mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-10 08:55:44 +00:00
fix(frontend): isNaN is unsafe
This commit is contained in:
@@ -259,7 +259,7 @@ const Layout = ({ children }) => {
|
|||||||
const dateObj = new Date(date);
|
const dateObj = new Date(date);
|
||||||
|
|
||||||
// Check if date is valid
|
// Check if date is valid
|
||||||
if (isNaN(dateObj.getTime())) return "Invalid date";
|
if (Number.isNaN(dateObj.getTime())) return "Invalid date";
|
||||||
|
|
||||||
const diff = now - dateObj;
|
const diff = now - dateObj;
|
||||||
const seconds = Math.floor(diff / 1000);
|
const seconds = Math.floor(diff / 1000);
|
||||||
|
|||||||
@@ -580,7 +580,7 @@ const Settings = () => {
|
|||||||
value={formData.updateInterval}
|
value={formData.updateInterval}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const val = parseInt(e.target.value);
|
const val = parseInt(e.target.value);
|
||||||
if (!isNaN(val)) {
|
if (!Number.isNaN(val)) {
|
||||||
handleInputChange(
|
handleInputChange(
|
||||||
"updateInterval",
|
"updateInterval",
|
||||||
Math.min(1440, Math.max(5, val)),
|
Math.min(1440, Math.max(5, val)),
|
||||||
|
|||||||
Reference in New Issue
Block a user