Skip to content

Commit

Permalink
Do not show Missing Translation logs in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
caleeli committed Sep 9, 2024
1 parent bc2da6c commit e8fbe93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion resources/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ window.ProcessMaker = {
missingTranslation(value) {
if (this.missingTranslations.has(value)) { return; }
this.missingTranslations.add(value);
console.warn("Missing Translation:", value);
if (!isProd) {
console.warn("Missing Translation:", value);
}
},

RequestChannel,
Expand Down Expand Up @@ -231,6 +233,7 @@ window.ProcessMaker.apiClient.defaults.headers.common["X-Requested-With"] = "XML
*/

const token = document.head.querySelector("meta[name=\"csrf-token\"]");
const isProd = document.head.querySelector("meta[name=\"is-prod\"]")?.content === "true";

if (token) {
window.ProcessMaker.apiClient.defaults.headers.common["X-CSRF-TOKEN"] = token.content;
Expand Down

0 comments on commit e8fbe93

Please sign in to comment.