|
|
|
|
@ -35,6 +35,9 @@ class Patcher { |
|
|
|
|
Preferences.executeOnce(Preferences.Keys.PATCH_BLINDS_FORMAT, context) { |
|
|
|
|
patchBlindFormat() |
|
|
|
|
} |
|
|
|
|
Preferences.executeOnce(Preferences.Keys.PATCH_NEGATIVE_LIMITS, context) { |
|
|
|
|
patchNegativeLimits() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Preferences.executeOnce(Preferences.Keys.ADD_NEW_TRANSACTION_TYPES, context) { |
|
|
|
|
|
|
|
|
|
@ -131,6 +134,17 @@ class Patcher { |
|
|
|
|
realm.close() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun patchNegativeLimits() { |
|
|
|
|
val realm = Realm.getDefaultInstance() |
|
|
|
|
realm.executeTransaction { |
|
|
|
|
val sessions = realm.where(Session::class.java).lessThan("limit", 0).findAll() |
|
|
|
|
sessions.forEach { session -> |
|
|
|
|
session.limit = null |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
realm.close() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
02/09/19: A bug with the session set management made them kept instead of deleted, |
|
|
|
|
thus making duration calculation wrong |
|
|
|
|
|