Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Commit afd75a3

Browse files
committed
JSON.stringify value by variable type
1 parent 77ff7f8 commit afd75a3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

debugdialog.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@
172172
return attributes
173173
}
174174

175+
function getFeatureVariableType(featureKey, variableKey) {
176+
var vmap = optimizelyClientInstance.getOptimizelyConfig().featuresMap[featureKey].variablesMap;
177+
return vmap[variableKey].type
178+
}
179+
175180
function run() {
176181
logs = []
177182
var logarea = document.getElementById('logsarea')
@@ -193,7 +198,7 @@
193198
break;
194199
case 'getFeatureVariable':
195200
response = optimizelyClientInstance.getFeatureVariable(key, variable, userid, attributes)
196-
if (typeof response === 'object') {
201+
if (getFeatureVariableType(key, variable) === "json") {
197202
response = JSON.stringify(response);
198203
}
199204
break;

0 commit comments

Comments
 (0)