fix 무한 스크롤 안되는 문제 해결

This commit is contained in:
이정수 2025-02-08 09:15:59 +09:00
parent 7078ba451c
commit db8d0e9eaa
1 changed files with 2 additions and 6 deletions

View File

@ -158,7 +158,6 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
{ {
if (isSearching) return; if (isSearching) return;
isSearching = true; isSearching = true;
Debug.Log("StartSearch");
var tcs = new TaskCompletionSource<bool>(); var tcs = new TaskCompletionSource<bool>();
@ -167,7 +166,6 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
request, request,
(data) => (data) =>
{ {
Debug.Log($"Done search {data.data.Count} / {data.hasMore}");
for (int n = 0; n < data.data.Count; n++) for (int n = 0; n < data.data.Count; n++)
{ {
searchResults.Enqueue(data.data[n]); searchResults.Enqueue(data.data[n]);
@ -182,7 +180,6 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
await tcs.Task; // 응답이 완료될 때까지 대기 await tcs.Task; // 응답이 완료될 때까지 대기
await RefreshScroll(); await RefreshScroll();
isSearching = false; isSearching = false;
Debug.Log("End Search");
} }
@ -201,7 +198,7 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
librarys.Add(result); librarys.Add(result);
} }
librarys.Sort((a,b) => a.owner_id.CompareTo(b.owner_id)); // librarys.Sort((a,b) => a.owner_id.CompareTo(b.owner_id));
} }
int n = 0; int n = 0;
@ -235,7 +232,6 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
{ {
for (int i = 0; itemPrefabs.Count > i; i++) for (int i = 0; itemPrefabs.Count > i; i++)
{ {
Debug.Log($"{i} - {itemPrefabs.Count}");
await GetImage(itemPrefabs[i].Library); await GetImage(itemPrefabs[i].Library);
itemPrefabs[i].ImageSet(); itemPrefabs[i].ImageSet();
} }
@ -246,7 +242,7 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
public void NextSearch() public void NextSearch()
{ {
if (isSearching) { if (isSearching == false) {
hasMore = false; hasMore = false;
request.page++; request.page++;
_ = SearchSuiters(); _ = SearchSuiters();