Skip to content

Commit 601123f

Browse files
committed
lint fix
1 parent 8736985 commit 601123f

File tree

1 file changed

+2
-1
lines changed
  • authenticator/src/main/java/com/amplifyframework/ui/authenticator/strings

1 file changed

+2
-1
lines changed

authenticator/src/main/java/com/amplifyframework/ui/authenticator/strings/StringResolver.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import android.annotation.SuppressLint
1919
import androidx.compose.runtime.Composable
2020
import androidx.compose.runtime.ReadOnlyComposable
2121
import androidx.compose.ui.platform.LocalContext
22+
import androidx.compose.ui.platform.LocalResources
2223
import androidx.compose.ui.res.pluralStringResource
2324
import androidx.compose.ui.res.stringResource
2425
import com.amplifyframework.auth.AuthException
@@ -143,7 +144,7 @@ internal open class StringResolver {
143144
// Check if the customer application has defined a specific string for this Exception type. If not, return
144145
// the generic error message.
145146
val resourceName = error.toResourceName()
146-
val resourceId = context.resources.getIdentifier(resourceName, "string", context.packageName)
147+
val resourceId = LocalResources.current.getIdentifier(resourceName, "string", context.packageName)
147148
val message = if (resourceId != 0) stringResource(resourceId) else null
148149
message ?: stringResource(R.string.amplify_ui_authenticator_error_unknown)
149150
}

0 commit comments

Comments
 (0)