Skip to content

Commit

Permalink
Wrap Code in an IIFE to prevent errors on reinvoke
Browse files Browse the repository at this point in the history
Wrapping code gets rid of variable redeclaration errors when a user goes
back, changes checkboxes and re-invokes the extension.

Thanks to @dark-trojan for pointing out the error.
  • Loading branch information
RachitKeertiDas committed Jun 18, 2022
1 parent 21f072a commit d439114
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gpa/activateGPA.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*
Source: https://github.com/IITH/aims-gpa-calculator
*/

(function () {
// wrap code in an IIFE to prevent redeclaration errors on re-invoke.
const excludeList = [
'minor core',
'honors core',
Expand Down Expand Up @@ -134,3 +135,4 @@ chrome.runtime.sendMessage({
action: 'parsedGPA',
data: showTotalGPA(),
});
})();

0 comments on commit d439114

Please sign in to comment.