From 1a259bb3aa442a2f369c61e882def62530e7efcd Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 27 Feb 2017 20:02:54 +0100 Subject: [PATCH] check if user has disallowed feedback api --- www/common/cryptpad-common.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 8e883e47a..f5246cd24 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -24,16 +24,9 @@ define([ Alertify: Alertify, }; - common.feedback = function (action) { - if (!action) { return; } - $.ajax({ - type: "HEAD", - url: '/common/feedback.html?' + action + '=' + (+new Date()), - }); - }; - var store; + var find = common.find = function (map, path) { return (map && path.reduce(function (p, n) { return typeof(p[n]) !== 'undefined' && p[n]; @@ -61,6 +54,17 @@ define([ return; }; + common.feedback = function (action) { + if (!action) { return; } + try { + if (!getStore().getProxy().proxy.allowUserFeedback) { return; } + } catch (e) { return void console.error(e); } + $.ajax({ + type: "HEAD", + url: '/common/feedback.html?' + action + '=' + (+new Date()), + }); + }; + var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) { realtime.sync(); realtime.onSettle(cb);