Commit 12321f6 1 parent 1f9e380 commit 12321f6 Copy full SHA for 12321f6
File tree 1 file changed +4
-3
lines changed
app/src/main/java/net/bible/service/sword
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ object SwordEnvironmentInitialisation {
99
99
SwordBookPath .setAugmentPath(arrayOf(SharedConstants .manualInstallDir, SharedConstants .manualInstallDir2))
100
100
}
101
101
102
+ private val messageShownLast = LruCache <String , Long >(100 );
103
+
102
104
/* * JSword calls back to this listener in the event of some types of error
103
105
*
104
106
*/
@@ -112,7 +114,6 @@ object SwordEnvironmentInitialisation {
112
114
showMsg(ev)
113
115
}
114
116
115
- val messageCache = LruCache <String , Long >(100 );
116
117
117
118
private fun showMsg (ev : ReporterEvent ? ) {
118
119
val msg = when {
@@ -122,8 +123,8 @@ object SwordEnvironmentInitialisation {
122
123
getResourceString(R .string.error_occurred_with_link, ev.exception.message!! )
123
124
else -> getResourceString(R .string.error_occurred)
124
125
}
125
- val lastShown = messageCache .get(msg)
126
- messageCache .put(msg, System .currentTimeMillis())
126
+ val lastShown = messageShownLast .get(msg)
127
+ messageShownLast .put(msg, System .currentTimeMillis())
127
128
if (lastShown != null && System .currentTimeMillis() - lastShown < FIVE_MINUTES_MS ) {
128
129
return // Error message has been shown recently, let's not spam user!
129
130
}
You can’t perform that action at this time.
0 commit comments