fix: 커뮤니티 게시물 조회 시 전역 스피너 비활성화 #375
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
관련 이슈
작업 내용
로딩 스피너를 불러오는 곳이 2가지(게시물 조회 시 isLoading, 전역 스피너의 isFetching)라 다음과 이와 같은 문제가 발생한 것으로 확인했습니다. 따라서 로딩 시, 1개의 로딩 스피너만 불러올 수 있도록 수정하였습니다.
기존 쿼리에 meta data 를 추가하여 수정하였으며, 추후에 다른 쿼리 및 페이지에서도 동일한 문제가 발생했을 경우, 같은 방식으로 해당 쿼리에 같은 meta data 만 추가한다면 문제를 해결할 수 있을 것이라 생각합니다!
특이 사항
리뷰 요구사항 (선택)
추후 다른 페이지에서도 동일한 문제가 발견되거나 새로운 페이지를 추가했을 경우 같은 문제가 생길 수도 있는 것을 감안하여 전역 스피너 관련 코드(index.tsx) 의 수정을 최소화하는 방안을 택하였습니다. 필요할 때마다 전역 스피너에 queryKey를 import하여 코드를 추가하게 된다면 코드가 지저분해질 것 같아서 이와 같은 방법을 택하였는데, 혹시 더 나은 방법이 있다면 알려주시면 감사하겠습니다! 피드백 부탁드리겠습니다☺️ !