Skip to content

Commit

Permalink
Handle invalid form condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Eerie16 committed Jun 14, 2021
1 parent c652000 commit 4f0b9b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ btn.onclick = function() {

chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
console.log("Hello From content without if");
if(request.greeting == "get-modal") {
console.log("Hello From content via popup");
// console.log("Hello From content without if");
if(request.greeting == "get-modal" && subjects.length > 2) {
// console.log("Hello From content via popup");
console.log(subjects.length);
arr1 = [];
var num = (subjects.length / 2);
for(let i = 1; i < num;i++) {
Expand All @@ -144,5 +145,8 @@ chrome.runtime.onMessage.addListener(
}
modalOn();
}
if(subjects.length <= 2) {
alert('NOT VALID FORM!!!')
}
});

0 comments on commit 4f0b9b5

Please sign in to comment.