handle cancel button on load key

This commit is contained in:
Michele Balistreri 2019-11-22 16:54:52 +03:00
parent 540716df5e
commit 4d43c2c642
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A

View File

@ -105,8 +105,10 @@ class MainActivity : AppCompatActivity(), ScriptListener {
}
private fun loadKeyHandler(resultCode: Int, data: Intent?) {
val loadType = data?.getIntExtra(LOAD_TYPE, LOAD_NONE) ?: LOAD_NONE
val mnemonic = data?.getStringExtra(LOAD_MNEMONIC)
if (resultCode != Activity.RESULT_OK || data == null) return
val loadType = data.getIntExtra(LOAD_TYPE, LOAD_NONE)
val mnemonic = data.getStringExtra(LOAD_MNEMONIC)
Registry.scriptExecutor.runScript(scriptWithAuthentication().plus(LoadKeyCommand(loadType, mnemonic)))
}