Skip to content

Commit de7bd7c

Browse files
author
Mike Chu
committed
revert: Odp browser & node .disabled handling inside the class
1 parent f1c8ee5 commit de7bd7c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

lib/plugins/odp_manager/index.browser.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2023-2024, Optimizely
2+
* Copyright 2023, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,6 +56,13 @@ export class BrowserOdpManager extends OdpManager {
5656

5757
this.logger = logger || getLogger();
5858

59+
if (odpOptions?.disabled) {
60+
this.initPromise = Promise.resolve();
61+
this.enabled = false;
62+
this.logger.log(LogLevel.INFO, LOG_MESSAGES.ODP_DISABLED);
63+
return;
64+
}
65+
5966
const browserClientEngine = JAVASCRIPT_CLIENT_ENGINE;
6067
const browserClientVersion = BROWSER_CLIENT_VERSION;
6168

lib/plugins/odp_manager/index.node.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2023-2024, Optimizely
2+
* Copyright 2023, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,6 +49,13 @@ export class NodeOdpManager extends OdpManager {
4949

5050
this.logger = logger || getLogger();
5151

52+
if (odpOptions?.disabled) {
53+
this.initPromise = Promise.resolve();
54+
this.enabled = false;
55+
this.logger.log(LogLevel.INFO, LOG_MESSAGES.ODP_DISABLED);
56+
return;
57+
}
58+
5259
const nodeClientEngine = NODE_CLIENT_ENGINE;
5360
const nodeClientVersion = NODE_CLIENT_VERSION;
5461

0 commit comments

Comments
 (0)