sr-npm 1.7.1302 → 1.7.1303

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.1302",
3
+ "version": "1.7.1303",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,8 +10,13 @@ const {
10
10
  } = require('../public/utils');
11
11
 
12
12
 
13
+ let siteconfig;
13
14
  async function positionPageOnReady(_$w) {
15
+ if(siteconfig===undefined) {
16
+ siteconfig = await wixData.query(COLLECTIONS.SITE_CONFIGS).find().then(result => result.items[0]);
17
+ }
14
18
  console.log("positionPageOnReady called");
19
+
15
20
  await bind(_$w);
16
21
 
17
22
 
@@ -34,6 +39,12 @@ async function getCategoryValue(customValues) {
34
39
 
35
40
  const item = await _$w('#datasetJobsItem').getCurrentItem();
36
41
  console.log("item: ",item);
42
+ let multiRefField;
43
+ if(siteconfig.customFields==="true") {
44
+ multiRefField=await getPositionWithMultiRefField(item._id);
45
+ console.log("multiRefField: ",multiRefField);
46
+ }
47
+
37
48
 
38
49
  handleReferFriendButton(_$w,item);
39
50
  handleApplyButton(_$w,item);
@@ -49,9 +60,7 @@ async function getCategoryValue(customValues) {
49
60
  if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) // when there is no department, we filter based on category
50
61
  {
51
62
 
52
- const multiRefField=await getPositionWithMultiRefField(item._id);
53
- const categoryValue=await getCategoryValue(multiRefField);
54
-
63
+ const categoryValue=await getCategoryValue(multiRefField);
55
64
  if(isElementExistOnPage(_$w('#jobCategory'))) {
56
65
  _$w('#jobCategory').text = categoryValue.title;
57
66
  }