Fixed warning

This commit is contained in:
Daniel 2022-05-11 13:34:19 +04:30
parent 3560182dca
commit 83e6fb20b9

View File

@ -32,7 +32,7 @@ const AddModal = ({onExit}) => {
return url.protocol === "http:" || url.protocol === "https:"; return url.protocol === "http:" || url.protocol === "https:";
} }
if(name != '' && isValidHttpUrl(link) && tag != '') { if(name !== '' && isValidHttpUrl(link) && tag !== '') {
const address = config.client.api_address + ":" + config.server.port; const address = config.client.api_address + ":" + config.server.port;
fetch(address + "/post", { fetch(address + "/post", {
@ -54,7 +54,7 @@ const AddModal = ({onExit}) => {
}); });
onExit(); onExit();
} else if(name != '' && link != '' && tag != '') { } else if(name !== '' && link !== '' && tag !== '') {
alert('Please make sure the link is valid.\n\n(i.e. starts with "http"/"https")'); alert('Please make sure the link is valid.\n\n(i.e. starts with "http"/"https")');
} }
@ -64,7 +64,7 @@ const AddModal = ({onExit}) => {
} }
function abort(e) { function abort(e) {
if (e.target.className == "overlay" || e.target.className == "cancel-btn") { if (e.target.className === "overlay" || e.target.className === "cancel-btn") {
onExit(); onExit();
} }
} }