mirror of
https://github.com/nacabaro/vbhelper.git
synced 2026-07-30 00:31:54 +00:00
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:
parent
07315fe11b
commit
05f04fdc49
@ -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)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user