Skip to content

Commit

Permalink
Merge pull request #1108 from Mintoo200/patch-1
Browse files Browse the repository at this point in the history
Fix event sent before state update
  • Loading branch information
AmauriC authored May 31, 2023
2 parents 43b6421 + 6a71b97 commit d3ce8de
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tarteaucitron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1023,16 +1023,16 @@ var tarteaucitron = {
tarteaucitron.sendEvent(key + '_loaded');
}
var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
if(status == true){
tarteaucitron.state[key] = status;
tarteaucitron.cookie.create(key, status);
tarteaucitron.userInterface.color(key, status);
if (status == true) {
itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
tarteaucitron.sendEvent(key + '_allowed');
}else{
} else {
itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
tarteaucitron.sendEvent(key + '_disallowed');
}
tarteaucitron.state[key] = status;
tarteaucitron.cookie.create(key, status);
tarteaucitron.userInterface.color(key, status);
}
}
},
Expand Down Expand Up @@ -1071,16 +1071,16 @@ var tarteaucitron = {
}
}
var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
if(status == true){
tarteaucitron.state[key] = status;
tarteaucitron.cookie.create(key, status);
tarteaucitron.userInterface.color(key, status);
if (status == true) {
itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
tarteaucitron.sendEvent(key + '_allowed');
}else{
} else {
itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
tarteaucitron.sendEvent(key + '_disallowed');
}
tarteaucitron.state[key] = status;
tarteaucitron.cookie.create(key, status);
tarteaucitron.userInterface.color(key, status);
},
"color": function (key, status) {
"use strict";
Expand Down

0 comments on commit d3ce8de

Please sign in to comment.