浏览代码

Prevent getquanty to be loaded twice

Amauri CHAMPEAUX 4 年之前
父节点
当前提交
f7a12bcb9a
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      tarteaucitron.services.js

+ 6 - 0
tarteaucitron.services.js

@@ -3934,6 +3934,10 @@ tarteaucitron.services.getquanty = {
             return;
         }
 
+        if (tarteaucitron.user.getquantyAlreadyLoaded !== undefined) {
+            return;
+        }
+
         tarteaucitron.addScript('https://get.smart-data-systems.com/gq?site_id=' + tarteaucitron.user.getguanty + '&consent=1');
     },
     "fallback": function () {
@@ -3942,6 +3946,8 @@ tarteaucitron.services.getquanty = {
             return;
         }
 
+        tarteaucitron.user.getquantyAlreadyLoaded = true;
+
         tarteaucitron.addScript('https://get.smart-data-systems.com/gq?site_id=' + tarteaucitron.user.getguanty + '&notrack=1');
     }
 };