mirror of
https://github.com/nacabaro/vbhelper.git
synced 2026-07-30 00:31:54 +00:00
Fix double character deletion causing crash on HCE transfer to VitalWear
Character was deleted from the local DB both right after sendCharacterToWatch and again in WritingScreen's completion callback. The second deletion failed because the character no longer existed, causing the reported random crash when sending back to the watch. Deletion is now handled only once, in WritingScreen.
This commit is contained in:
parent
df713855f5
commit
931f730406
@ -231,9 +231,7 @@ class ScanScreenControllerImpl(
|
|||||||
val proto = VitalWearCharacterExporter(componentActivity, database).buildCharacterProto(characterId)
|
val proto = VitalWearCharacterExporter(componentActivity, database).buildCharacterProto(characterId)
|
||||||
val client = VitalWearHceReaderClient(isoDep)
|
val client = VitalWearHceReaderClient(isoDep)
|
||||||
client.sendCharacterToWatch(proto)
|
client.sendCharacterToWatch(proto)
|
||||||
database.userCharacterDao().deleteCharacterById(characterId)
|
Log.i("NFC_WRITE", "Character sent to VitalWear (id=$characterId), deletion deferred to WritingScreen")
|
||||||
pendingExportCharacterId = null
|
|
||||||
Log.i("NFC_WRITE", "Character sent to VitalWear and deleted from app (id=$characterId)")
|
|
||||||
componentActivity.runOnUiThread {
|
componentActivity.runOnUiThread {
|
||||||
Toast.makeText(componentActivity, componentActivity.getString(R.string.scan_sent_character_success), Toast.LENGTH_SHORT).show()
|
Toast.makeText(componentActivity, componentActivity.getString(R.string.scan_sent_character_success), Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user