Skip to content

Commit a070e9a

Browse files
author
brizental
committed
Return easly if disabled, not otherwise
1 parent 563ddc6 commit a070e9a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "./dist/glean.js",
66
"scripts": {
77
"test": "npm run build:test-webext && ts-mocha tests/**/*.spec.ts --paths -p ./tsconfig.json --timeout 0",
8-
"test:debug": "ts-mocha --paths -p ./tsconfig.json --inspect-brk",
8+
"test:debug": "ts-mocha tests/**/*.spec.ts --paths -p ./tsconfig.json --inspect-brk",
99
"lint": "eslint . --ext .ts,.js,.json",
1010
"fix": "eslint . --ext .ts,.js,.json --fix",
1111
"build:webext": "webpack --config webpack.config.webext.js --mode production",

src/database.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ class Database {
9999
* @param value The value we want to record to the given metric.
100100
*/
101101
async record(metric: Metric, value: string): Promise<void> {
102-
if (!metric.disabled) {
102+
debugger;
103+
if (metric.disabled) {
103104
return;
104105
}
105106

@@ -118,7 +119,7 @@ class Database {
118119
* @param transformFn The transformation function to apply to the currently persisted value.
119120
*/
120121
async transform(metric: Metric, transformFn: (v?: string) => string): Promise<void> {
121-
if (!metric.disabled) {
122+
if (metric.disabled) {
122123
return;
123124
}
124125

0 commit comments

Comments
 (0)