mirror of
https://github.com/Darkrock-Studios/hammer-editor.git
synced 2026-10-19 09:34:23 +00:00
Squash merge no-in-app-changelog-on-apple into develop
This commit is contained in:
parent
aa51c311dc
commit
4ad20162f4
7 changed files with 44 additions and 4 deletions
|
|
@ -0,0 +1,3 @@
|
|||
package com.darkrockstudios.apps.hammer.common.data.changelog
|
||||
|
||||
actual val supportsInAppChangelog: Boolean = true
|
||||
|
|
@ -16,6 +16,8 @@ class ChangelogRepository(
|
|||
private var cached: Changelog? = null
|
||||
|
||||
suspend fun getChangelog(): Changelog? {
|
||||
if (!supportsInAppChangelog) return null
|
||||
|
||||
lock.withLock { cached }?.let { return it }
|
||||
|
||||
val changelog = datasource.loadChangelog() ?: return null
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.darkrockstudios.apps.hammer.common.data.changelog
|
||||
|
||||
/**
|
||||
* Whether the in-app "What's New" dialog may be shown at all.
|
||||
*
|
||||
* False wherever Apple reviews the build. The baked changelog is the full release
|
||||
* entry, so it names Android and other platforms, which draws guideline 2.3.10
|
||||
* rejections.
|
||||
*/
|
||||
expect val supportsInAppChangelog: Boolean
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package com.darkrockstudios.apps.hammer.common.data.changelog
|
||||
|
||||
import com.darkrockstudios.apps.hammer.common.IS_APP_STORE
|
||||
|
||||
// Only the Mac App Store flavor faces review; direct downloads keep the dialog.
|
||||
actual val supportsInAppChangelog: Boolean = !IS_APP_STORE
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.darkrockstudios.apps.hammer.common.data.changelog
|
||||
|
||||
actual val supportsInAppChangelog: Boolean = false
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.darkrockstudios.apps.hammer.common.data.changelog
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertFalse
|
||||
|
||||
class InAppChangelogSupportTest {
|
||||
|
||||
// Apple rejects the baked changelog under guideline 2.3.10 for naming other platforms.
|
||||
@Test
|
||||
fun `in-app changelog is never shown on iOS`() {
|
||||
assertFalse(supportsInAppChangelog)
|
||||
}
|
||||
}
|
||||
|
|
@ -66,6 +66,7 @@ import com.darkrockstudios.apps.hammer.common.compose.icons.Github
|
|||
import com.darkrockstudios.apps.hammer.common.compose.icons.Reddit
|
||||
import com.darkrockstudios.apps.hammer.common.compose.resources.get
|
||||
import com.darkrockstudios.apps.hammer.common.compose.scrollBarOverlay
|
||||
import com.darkrockstudios.apps.hammer.common.data.changelog.supportsInAppChangelog
|
||||
import com.darkrockstudios.apps.hammer.hammer_icon
|
||||
import org.jetbrains.compose.resources.painterResource
|
||||
|
||||
|
|
@ -320,10 +321,12 @@ private fun VersionCard(
|
|||
horizontalArrangement = Arrangement.spacedBy(14.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(14.dp),
|
||||
) {
|
||||
HdHairlineButton(
|
||||
label = Res.string.about_version_changes_button.get(),
|
||||
onClick = onViewChangelog,
|
||||
)
|
||||
if (supportsInAppChangelog) {
|
||||
HdHairlineButton(
|
||||
label = Res.string.about_version_changes_button.get(),
|
||||
onClick = onViewChangelog,
|
||||
)
|
||||
}
|
||||
HdHairlineButton(
|
||||
label = Res.string.about_version_github_button.get(),
|
||||
onClick = onOpenLatestRelease,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue