fix: 홈 네이티브 광고가 배틀 섹션 위로 노출되던 문제 수정 - #42
Open
rrheon wants to merge 1 commit into
Open
Conversation
네이티브 광고 뷰가 배틀 섹션 조건 밖에 무조건 그려지고 있었다. 그래서 ① onAppear 도착 전 첫 프레임(스켈레톤 조건이 isLoading 만 봐서 미발동)과 ② 홈 API 실패·hotBattles 빈 응답 때 섹션만 접히면서 광고가 화면 최상단으로 올라왔다. - 광고를 "지금 뜨는 배틀" 아래로 넣고, 그 섹션이 비면 "Best 배틀" 아래로 폴백한다. if/else 라 AdFit 의 "한 화면에 같은 단위 1개" 제약은 그대로 지킨다. - 스켈레톤 조건에 !hasLoadedHome 을 더해 첫 프레임을 덮는다. - hasLoadedHome 을 성공했을 때만 세운다. 실패까지 완료로 굳히면 재진입해도 영영 재요청하지 않아 빈 홈에 갇힌다. Stage 빌드·시뮬로 히어로 → 지금뜨는배틀 → 광고 → Best배틀 순서 육안 확인.
Contributor
|
제출된 PR의 변경 사항들은 설명된 버그를 효과적으로 수정하며, 프로젝트의 아키텍처, SwiftUI 컨벤션 및 코드 품질 가이드라인을 잘 준수합니다. 특히 |
Roy-wonji
reviewed
Aug 12, 2026
| state.hasLoadedHome = true | ||
| switch result { | ||
| case let .success(bundle): | ||
| // 실패까지 로드 완료로 굳히면 재진입해도 영영 재요청하지 않아 |
| ) | ||
| } | ||
|
|
||
| // 광고는 반드시 배틀 섹션 아래에만 노출한다 — 섹션 밖에 홀로 두면 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
요약
홈 상단에 네이티브 광고가 "지금 뜨는 배틀" 위로 떠오르던 노출 순서 버그 수정.
🐛 버그 수정
네이티브 광고 노출 위치 오류 (광고가 배틀 섹션 위로 올라가는 현상)
원인: AdFitNativeAdView가 배틀 섹션 조건문 밖에 위치하여, 화면 렌더링 시 조건과 무관하게 노출되면서 최상단으로 올라감.
재현 1: onAppear 진입 전 첫 프레임 (스켈레톤 조건이 isLoading만 확인해 광고 자리만 먼저 노출)
재현 2: 홈 API 실패 또는 hotBattles 응답이 빈 배열일 때 (배틀 섹션은 접히고 광고만 남음)
해결:
광고 뷰를 !hotBattles.isEmpty 분기 안쪽(지금 뜨는 배틀 바로 아래)으로 이동.
hotBattles 섹션이 비어있을 경우, 광고가 "Best 배틀" 아래로 노출되도록 처리.
두 위치에 동시에 렌더링되지 않도록 AdFit의 '1화면 1광고 단위' 제약을 준수
테스트 플랜
hotBattles가 비면 광고가 Best 배틀 아래로 이동