web: do not disable telemetry toggle if DNT=true

This commit is contained in:
Abdullah Atta
2023-01-17 12:56:18 +05:00
committed by Abdullah Atta
parent 2da32e27ff
commit a7369bf869
2 changed files with 3 additions and 8 deletions

View File

@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import Config from "./config";
export function isTelemetryEnabled() {
return !doNotTrack() && Config.get("telemetry", true);
export function isTelemetryEnabled(ignoreDNT = false) {
return (ignoreDNT || !doNotTrack()) && Config.get("telemetry", true);
}
export function setTelemetry(state: boolean) {

View File

@@ -823,16 +823,11 @@ function Settings() {
<Toggle
title="Enable telemetry"
onTip="Usage data & crash reports will be sent to us (no 3rd party involved) for analytics. All data is anonymous as mentioned in our privacy policy."
offTip={
isTelemetryDisabled
? "All telemetry is disabled because of Do Not Track being enabled in your browser."
: "Do not collect any data or crash reports"
}
offTip={"Do not collect any data or crash reports"}
onToggled={() => {
setEnableTelemetry(!enableTelemetry);
}}
isToggled={enableTelemetry}
disabled={isTelemetryDisabled}
/>
<Button variant="list" onClick={showTrackingDetailsDialog}>
<Tip