@haloduck/ui 2.0.29 → 2.0.30

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.
@@ -2893,7 +2893,7 @@ class AutoLoadDirective {
2893
2893
  ngZone = inject(NgZone);
2894
2894
  observer;
2895
2895
  isLoading = false;
2896
- hasLoadedOnce = false;
2896
+ hasTriggeredOnce = false;
2897
2897
  autoLoadEnabled = true;
2898
2898
  autoLoadThreshold = 0.1;
2899
2899
  autoLoadRootMargin = '0px';
@@ -2927,29 +2927,27 @@ class AutoLoadDirective {
2927
2927
  if (this.isLoading || !this.autoLoadEnabled) {
2928
2928
  return;
2929
2929
  }
2930
- // 무한 로드 방지: 첫 번째 보임 감지 시에는 로드하지 않고,
2931
- // 실제로 사용자가 스크롤해서 다시 보일 때만 로드
2932
- if (this.hasLoadedOnce) {
2930
+ // 첫 번째 로드는 건너뛰고, 이후부터는 보일 때마다 자동 로드
2931
+ if (this.hasTriggeredOnce) {
2933
2932
  this.isLoading = true;
2934
2933
  this.autoLoadTrigger.emit();
2935
- // 로딩 상태를 일정 시간 후 해제하여 중복 로드 방지
2936
- setTimeout(() => {
2937
- this.isLoading = false;
2938
- }, 2000);
2939
2934
  // 옵저버를 일시적으로 해제하여 연속 트리거 방지
2940
2935
  this.temporarilyDisableObserver();
2941
2936
  }
2942
- this.hasLoadedOnce = true;
2937
+ else {
2938
+ this.hasTriggeredOnce = true;
2939
+ }
2943
2940
  }
2944
2941
  temporarilyDisableObserver() {
2945
2942
  if (this.observer) {
2946
2943
  this.observer.disconnect();
2947
- // 2초 후 옵저버 재연결
2944
+ // 1초 후 옵저버 재연결
2948
2945
  setTimeout(() => {
2949
2946
  if (this.autoLoadEnabled && this.observer) {
2947
+ this.isLoading = false;
2950
2948
  this.observer.observe(this.elementRef.nativeElement);
2951
2949
  }
2952
- }, 2000);
2950
+ }, 1000);
2953
2951
  }
2954
2952
  }
2955
2953
  disconnect() {
@@ -2963,7 +2961,7 @@ class AutoLoadDirective {
2963
2961
  }
2964
2962
  // 자동 로드를 재활성화하는 메서드
2965
2963
  resetAutoLoad() {
2966
- this.hasLoadedOnce = false;
2964
+ this.hasTriggeredOnce = false;
2967
2965
  this.isLoading = false;
2968
2966
  }
2969
2967
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AutoLoadDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });