ide-assi 0.557.0 → 0.558.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.
@@ -203034,7 +203034,18 @@ class IdeLoadingTips extends HTMLElement {
203034
203034
  * Advances to the next tip and calls showCurrentTip() to display it.
203035
203035
  */
203036
203036
  showNextTip() {
203037
- this.#currentTipIndex = (this.#currentTipIndex + 1) % this.#tips.length;
203037
+ if (this.#tips.length <= 1) {
203038
+ // 팁이 하나뿐이거나 없으면 다음 팁을 보여줄 필요가 없음
203039
+ this.showCurrentTip(); // 현재 팁을 그냥 다시 표시
203040
+ return;
203041
+ }
203042
+
203043
+ let nextIndex;
203044
+ do {
203045
+ nextIndex = Math.floor(Math.random() * this.#tips.length);
203046
+ } while (nextIndex === this.#currentTipIndex); // 현재 인덱스와 같으면 다시 뽑기
203047
+
203048
+ this.#currentTipIndex = nextIndex;
203038
203049
  this.showCurrentTip();
203039
203050
  }
203040
203051
 
@@ -203030,7 +203030,18 @@ class IdeLoadingTips extends HTMLElement {
203030
203030
  * Advances to the next tip and calls showCurrentTip() to display it.
203031
203031
  */
203032
203032
  showNextTip() {
203033
- this.#currentTipIndex = (this.#currentTipIndex + 1) % this.#tips.length;
203033
+ if (this.#tips.length <= 1) {
203034
+ // 팁이 하나뿐이거나 없으면 다음 팁을 보여줄 필요가 없음
203035
+ this.showCurrentTip(); // 현재 팁을 그냥 다시 표시
203036
+ return;
203037
+ }
203038
+
203039
+ let nextIndex;
203040
+ do {
203041
+ nextIndex = Math.floor(Math.random() * this.#tips.length);
203042
+ } while (nextIndex === this.#currentTipIndex); // 현재 인덱스와 같으면 다시 뽑기
203043
+
203044
+ this.#currentTipIndex = nextIndex;
203034
203045
  this.showCurrentTip();
203035
203046
  }
203036
203047
 
@@ -139,7 +139,18 @@ class IdeLoadingTips extends HTMLElement {
139
139
  * Advances to the next tip and calls showCurrentTip() to display it.
140
140
  */
141
141
  showNextTip() {
142
- this.#currentTipIndex = (this.#currentTipIndex + 1) % this.#tips.length;
142
+ if (this.#tips.length <= 1) {
143
+ // 팁이 하나뿐이거나 없으면 다음 팁을 보여줄 필요가 없음
144
+ this.showCurrentTip(); // 현재 팁을 그냥 다시 표시
145
+ return;
146
+ }
147
+
148
+ let nextIndex;
149
+ do {
150
+ nextIndex = Math.floor(Math.random() * this.#tips.length);
151
+ } while (nextIndex === this.#currentTipIndex); // 현재 인덱스와 같으면 다시 뽑기
152
+
153
+ this.#currentTipIndex = nextIndex;
143
154
  this.showCurrentTip();
144
155
  }
145
156
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.557.0",
4
+ "version": "0.558.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -139,7 +139,18 @@ class IdeLoadingTips extends HTMLElement {
139
139
  * Advances to the next tip and calls showCurrentTip() to display it.
140
140
  */
141
141
  showNextTip() {
142
- this.#currentTipIndex = (this.#currentTipIndex + 1) % this.#tips.length;
142
+ if (this.#tips.length <= 1) {
143
+ // 팁이 하나뿐이거나 없으면 다음 팁을 보여줄 필요가 없음
144
+ this.showCurrentTip(); // 현재 팁을 그냥 다시 표시
145
+ return;
146
+ }
147
+
148
+ let nextIndex;
149
+ do {
150
+ nextIndex = Math.floor(Math.random() * this.#tips.length);
151
+ } while (nextIndex === this.#currentTipIndex); // 현재 인덱스와 같으면 다시 뽑기
152
+
153
+ this.#currentTipIndex = nextIndex;
143
154
  this.showCurrentTip();
144
155
  }
145
156