Fix LaunchedEffect key so characterToNfc runs when active character loads

When launching the scan screen from the home button, characterId is
loaded asynchronously from the active character. The previous key
(storageRepository) never re-triggered the effect, so characterToNfc
(which sets pendingExportCharacterId) was skipped if characterId was
null on first composition, making the HCE delete unreachable.
This commit is contained in:
b13st 2026-06-24 15:40:19 +02:00
parent 07315fe11b
commit 05f04fdc49

View File

@ -44,14 +44,8 @@ fun ScanScreen(
val context = LocalContext.current
LaunchedEffect(storageRepository) {
LaunchedEffect(characterId) {
withContext(Dispatchers.IO) {
/*
First check if there is a character sent through the navigation system
If there is not, that means we got here through the home screen nfc button
If we got here through the home screen, it does not hurt to check if there is
an active character.
*/
if (characterId != null && nfcCharacter == null) {
nfcCharacter = scanScreenController.characterToNfc(characterId)
}