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
416b30f7a8
commit
4eaf6cdf1b
@ -231,9 +231,7 @@ class ScanScreenControllerImpl(
|
||||
val proto = VitalWearCharacterExporter(componentActivity, database).buildCharacterProto(characterId)
|
||||
val client = VitalWearHceReaderClient(isoDep)
|
||||
client.sendCharacterToWatch(proto)
|
||||
database.userCharacterDao().deleteCharacterById(characterId)
|
||||
pendingExportCharacterId = null
|
||||
Log.i("NFC_WRITE", "Character sent to VitalWear and deleted from app (id=$characterId)")
|
||||
Log.i("NFC_WRITE", "Character sent to VitalWear (id=$characterId), deletion deferred to WritingScreen")
|
||||
componentActivity.runOnUiThread {
|
||||
Toast.makeText(componentActivity, componentActivity.getString(R.string.scan_sent_character_success), Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user