@betarena/ad-engine 0.3.3 → 0.4.0

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": "@betarena/ad-engine",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
5
  "description": "Betarena ad-engine widget",
6
6
  "keywords": [
@@ -92,6 +92,11 @@
92
92
  * 📝 `List` of **tag ids**
93
93
  */
94
94
  authorArticleTagIds: number[] = [],
95
+ /**
96
+ * @description
97
+ * 📝 Logged-in users should bypass the initial global slider delay.
98
+ */
99
+ isLoggedIn = false,
95
100
  /**
96
101
  * @description
97
102
  * 📝 Dark theme value
@@ -671,7 +676,8 @@
671
676
  target: document.body,
672
677
  props:
673
678
  {
674
- adData
679
+ adData,
680
+ isLoggedIn
675
681
  }
676
682
  }
677
683
  )
@@ -754,7 +760,8 @@
754
760
  target: document.body,
755
761
  props:
756
762
  {
757
- adData
763
+ adData,
764
+ isLoggedIn
758
765
  }
759
766
  }
760
767
  )
@@ -812,7 +819,8 @@
812
819
  target: document.body,
813
820
  props:
814
821
  {
815
- adData
822
+ adData,
823
+ isLoggedIn
816
824
  }
817
825
  }
818
826
  )
@@ -72,7 +72,12 @@
72
72
  /**
73
73
  * @augments AdsCreativeMain
74
74
  */
75
- adData: AdsCreativeMain
75
+ adData: AdsCreativeMain,
76
+ /**
77
+ * @description
78
+ * 📝 Logged-in users should not wait for the initial advert show delay.
79
+ */
80
+ isLoggedIn = false
76
81
  ;
77
82
 
78
83
  const
@@ -138,12 +143,8 @@
138
143
  {
139
144
  if (!isBetarenaAdShownForToday)
140
145
  {
141
- // ╭─────
142
- // NOTE: |:| Advert timeour start
143
- // ╰─────
144
- intTimeoutForAdvertShow = setTimeout
145
- (
146
- () =>
146
+ const
147
+ showAdvert = () =>
147
148
  {
148
149
  isAdvertShown = true;
149
150
 
@@ -166,9 +167,21 @@
166
167
  );
167
168
 
168
169
  return;
169
- },
170
- timeoutForAdvertShow
171
- );
170
+ }
171
+ ;
172
+
173
+ // ╭─────
174
+ // │ NOTE: |:| Advert timeout start
175
+ // ╰─────
176
+ if (isLoggedIn)
177
+ showAdvert();
178
+ else
179
+ intTimeoutForAdvertShow = setTimeout
180
+ (
181
+ showAdvert,
182
+ timeoutForAdvertShow
183
+ )
184
+ ;
172
185
 
173
186
  storeAdmin.updateData
174
187
  (