Skip to content

Commit ce804bd

Browse files
committed
Refactor: Adjust interstitial ad frequency in PostDetailScreen
- Changed the random condition for showing interstitial ads from `Random.nextInt(3) == 1` to `Random.nextInt(5) == 1`. This reduces the likelihood of an interstitial ad appearing on the post detail screen.
1 parent b220bda commit ce804bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

feature/post/src/commonMain/kotlin/me/matsumo/fanbox/feature/post/detail/PostDetailScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ internal fun PostDetailRoute(
154154
val revealOverlayContainerColor = MaterialTheme.colorScheme.tertiaryContainer
155155
val revealOverlayContentColor = MaterialTheme.colorScheme.onTertiaryContainer
156156

157-
val shouldShowInterstitialAdRandom by remember(postId) { mutableStateOf(Random.nextInt(3) == 1) }
157+
val shouldShowInterstitialAdRandom by remember(postId) { mutableStateOf(Random.nextInt(5) == 1) }
158158
val interstitialAdState = rememberInterstitialAdState(
159159
adUnitId = LocalPixiViewConfig.current.interstitialAdUnitId,
160160
enable = !uiState.setting.hasPrivilege && uiState.setting.shouldShowInterstitialAd && shouldShowInterstitialAdRandom,

0 commit comments

Comments
 (0)