Flip negated conditions to positive for readability (S7735)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -506,12 +506,12 @@ export async function renameModal(rename, type, id, baseName) {
|
||||
const inputField = Swal.getInput();
|
||||
|
||||
inputField.addEventListener("input", function () {
|
||||
if (!inputField.value.trim()) {
|
||||
confirmButton.classList.add("disable-hover");
|
||||
confirmButton.disabled = true;
|
||||
} else {
|
||||
if (inputField.value.trim()) {
|
||||
confirmButton.classList.remove("disable-hover");
|
||||
confirmButton.disabled = false;
|
||||
} else {
|
||||
confirmButton.classList.add("disable-hover");
|
||||
confirmButton.disabled = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -231,7 +231,9 @@ export function getXIndex(data, xValue) {
|
||||
* or null if the input is NaN.
|
||||
*/
|
||||
export function formatTime(seconds) {
|
||||
if (!Number.isNaN(Number(seconds))) {
|
||||
if (Number.isNaN(Number(seconds))) {
|
||||
return null;
|
||||
} else {
|
||||
const remainingSeconds = seconds % 60;
|
||||
const minutes = (Math.floor(seconds - remainingSeconds) / 60) % 60;
|
||||
const hours = Math.floor(seconds / 3600) % 24;
|
||||
@@ -250,8 +252,6 @@ export function formatTime(seconds) {
|
||||
result += `${remainingSeconds}s`;
|
||||
|
||||
return result.trim(); // Remove trailing whitespace
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user