mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
fix: read backup-conflict labels through LocalResources
Android lint's LocalContextGetResourceValueCall fails the build on rememberPresentation: context.getString is not configuration-aware. LocalResources.current invalidates on configuration changes, so the remembered labels follow a locale change. main fails the same lint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0168wY9t7i9NC5u3svyMxEz6
This commit is contained in:
+3
-3
@@ -23,7 +23,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.backups
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalResources
|
||||
import com.vitorpamplona.amethyst.R
|
||||
import com.vitorpamplona.amethyst.commons.model.backups.BackupEventType
|
||||
import com.vitorpamplona.quartz.concord.cord02Community.ConcordCommunityListDiff
|
||||
@@ -242,8 +242,8 @@ private fun arrow(
|
||||
*/
|
||||
@Composable
|
||||
fun rememberPresentation(diff: EventDiff): DiffPresentation {
|
||||
val context = LocalContext.current
|
||||
return remember(diff, context) { presentationOf(diff) { context.getString(it) } }
|
||||
val resources = LocalResources.current
|
||||
return remember(diff, resources) { presentationOf(diff) { resources.getString(it) } }
|
||||
}
|
||||
|
||||
/** Turns each event's own diff into typed, labelled groups. [str] resolves the labels. */
|
||||
|
||||
Reference in New Issue
Block a user