sfc-utils 1.4.156 → 1.4.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/personalize.js +19 -6
package/package.json
CHANGED
package/personalize.js
CHANGED
|
@@ -7,13 +7,26 @@ const getProfileProperty = (property) => {
|
|
|
7
7
|
const checkForBlueConic = (innerResolve) => {
|
|
8
8
|
if (window.blueConicClient) {
|
|
9
9
|
const profile = window.blueConicClient.profile.getProfile();
|
|
10
|
-
|
|
10
|
+
// Check if property is an array
|
|
11
|
+
let properties = [];
|
|
12
|
+
let isArray = false;
|
|
13
|
+
if (Array.isArray(property)) {
|
|
14
|
+
properties = property;
|
|
15
|
+
isArray = true;
|
|
16
|
+
} else {
|
|
17
|
+
properties = [property];
|
|
18
|
+
}
|
|
11
19
|
profile.loadValues(properties, this, function () {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
if (isArray) {
|
|
21
|
+
console.log("getProfileProperty ARRAY VAL", properties);
|
|
22
|
+
innerResolve({ properties: properties, profile: profile });
|
|
23
|
+
} else {
|
|
24
|
+
var value = profile.getValue(property);
|
|
25
|
+
// Return a valid result or null
|
|
26
|
+
value = value || null;
|
|
27
|
+
console.log("getProfileProperty VAL", value);
|
|
28
|
+
innerResolve({ existingValue: value, profile: profile });
|
|
29
|
+
}
|
|
17
30
|
});
|
|
18
31
|
} else {
|
|
19
32
|
attempts++;
|