@haloduck/ui 2.0.29 → 2.0.31

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