sr-npm 1.7.945 → 1.7.946

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.945",
3
+ "version": "1.7.946",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -35,8 +35,7 @@ async function getCategoryValueId(customValues) {
35
35
  _$w('#datasetJobsItem').onReady(async () => {
36
36
 
37
37
  const item = await _$w('#datasetJobsItem').getCurrentItem();
38
- const multiRefField=await getPositionWithMultiRefField(item._id);
39
- const categoryValueId=await getCategoryValueId(multiRefField);
38
+
40
39
  handleReferFriendButton(_$w,item);
41
40
  handleApplyButton(_$w,item);
42
41
 
@@ -49,8 +48,12 @@ async function getCategoryValueId(customValues) {
49
48
  {
50
49
  _$w('#additionalInfoText').text = htmlToText(item.jobDescription.additionalInformation.text);
51
50
  }
52
- if(_$w('#relatedJobsRepNoDepartment')) // when there is no department, we filter based on category
51
+ if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) // when there is no department, we filter based on category
53
52
  {
53
+
54
+ const multiRefField=await getPositionWithMultiRefField(item._id);
55
+ const categoryValueId=await getCategoryValueId(multiRefField);
56
+
54
57
  const relatedJobs = await getRelatedJobs({ categoryValueId, itemId: item._id ,limit:5});
55
58
  _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
56
59
  $item('#relatedJobTitle').text = itemData.title;
@@ -61,6 +64,7 @@ async function getCategoryValueId(customValues) {
61
64
 
62
65
  }
63
66
  });
67
+ if(isElementExistOnPage(_$w('#relatedJobsRepNoDepartment'))) {
64
68
  _$w('#relatedJobsNoDepartmentItem').onClick((event) => {
65
69
  const data = _$w("#relatedJobsRepNoDepartment").data;
66
70
  const clickedItemData = data.find(
@@ -68,6 +72,7 @@ async function getCategoryValueId(customValues) {
68
72
  );
69
73
  location.to(clickedItemData["link-jobs-title"]);
70
74
  });
75
+ }
71
76
  if(isElementExistOnPage(_$w('#relatedJobsDataset')))
72
77
  {
73
78
  _$w('#relatedJobsDataset').onReady(() => {