depromeet / ahmatda-web

아맞다 :white_check_mark: 이젠 까먹지 말고 챙기자
https://github.com/depromeet/ahmatda-web#download
7 stars 0 forks source link

간혈적 무한 로딩 현상 해결 #265

Closed hyesungoh closed 1 year ago

hyesungoh commented 1 year ago

🤔 해결하려는 문제가 무엇인가요?

🎉 어떻게 해결했나요?

온보딩에서 홈으로 넘어갈 때 카테고리 조회, 사용자 템플릿 조회 (카테고리가 선택된 상태에서) 이 두 개의 조회가 이루어져요

문제는 카테고리 조회 이후에 초기 첫 번째 카테고리를 전역 상태로 set하는 과정에 있었는데요

현재 선택된 카테고리가 있을 경우 넘어가는 로직을 !== null로 비교를 해서 발생했었어요.

조회되기 전 (로딩중 일 때) null이 아닌 undefined가 set된 이후에, 조회된 후 set을 할려는데 undefined !== null이라 발생했었어요!

📚 Attachment (Option)

github-actions[bot] commented 1 year ago

Bundle Sizes

Compared against afeace33b70ae438682384a853f18a580b53e0f1

Route: No significant changes found

Dynamic import: No significant changes found