Adds logs for crash investigation

hh
Laurent 6 years ago
parent f7095db30c
commit 5c9106ac50
  1. 25
      app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionFragment.kt

@ -204,32 +204,34 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate {
return
}
val data = currentSession.editDescriptors(row)
val session = this.currentSession
val data = session.editDescriptors(row)
when (row) {
SessionRow.START_DATE -> DateTimePickerManager.create(requireContext(), row, this, currentSession.startDate)
SessionRow.START_DATE -> DateTimePickerManager.create(requireContext(), row, this, session.startDate)
SessionRow.END_DATE -> {
if (this.currentSession.startDate == null) {
if (session.startDate == null) {
Toast.makeText(context, R.string.session_missing_start_date, Toast.LENGTH_SHORT).show()
} else {
DateTimePickerManager.create(
requireContext(),
row,
this,
currentSession.endDate ?: currentSession.startDate ?: Date(),
currentSession.startDate
session.endDate ?: session.startDate ?: Date(),
session.startDate
)
}
}
SessionRow.BANKROLL -> {
BottomSheetFragment.create(requireFragmentManager(), row, this, data, false, currentSession.currency)
BottomSheetFragment.create(requireFragmentManager(), row, this, data, false, session.currency)
}
SessionRow.HANDS -> {
val hhIds = this.currentSession.handHistories?.map { it.id }?.toTypedArray()
val hhIds = session.handHistories?.map { it.id }?.toTypedArray()
DataListActivity.newInstance(this, LiveData.HAND_HISTORY, false, hhIds, false)
}
else -> BottomSheetFragment.create(requireFragmentManager(), row, this, data, currentCurrency = currentSession.currency)
else -> BottomSheetFragment.create(requireFragmentManager(), row, this, data, currentCurrency = session.currency)
}
}
@ -386,10 +388,11 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate {
* Delete a session
*/
private fun deleteSession() {
currentSession.bankroll?.id?.let { id ->
BankrollReportManager.notifyBankrollReportImpact(id)
Crashlytics.log("Session has been deleted")
this.currentSession.bankroll?.id?.let { bankrollId ->
BankrollReportManager.notifyBankrollReportImpact(bankrollId)
}
currentSession.delete()
this.currentSession.delete()
activity?.finish()
}

Loading…
Cancel
Save