aboutsummaryrefslogtreecommitdiff
path: root/merchant-terminal
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-09-09 08:57:47 -0300
committerTorsten Grote <t@grobox.de>2020-09-09 13:16:19 -0300
commitcab40e31124b3a2438f56bee42e1dd31def6d8f5 (patch)
tree2e79730c8ed089481f8173ea099d57d08b475e8e /merchant-terminal
parentae60909a445e13edc83506648a1be95134ccdf95 (diff)
downloadtaler-android-cab40e31124b3a2438f56bee42e1dd31def6d8f5.tar.gz
taler-android-cab40e31124b3a2438f56bee42e1dd31def6d8f5.tar.bz2
taler-android-cab40e31124b3a2438f56bee42e1dd31def6d8f5.zip
[pos] improve error message when fetching the history fails
Diffstat (limited to 'merchant-terminal')
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryFragment.kt3
-rw-r--r--merchant-terminal/src/main/res/values/strings.xml1
2 files changed, 3 insertions, 1 deletions
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryFragment.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryFragment.kt
index c7cd8ba..2993177 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryFragment.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryFragment.kt
@@ -31,6 +31,7 @@ import net.taler.common.navigate
import net.taler.common.showError
import net.taler.merchantlib.OrderHistoryEntry
import net.taler.merchantpos.MainViewModel
+import net.taler.merchantpos.R
import net.taler.merchantpos.databinding.FragmentMerchantHistoryBinding
import net.taler.merchantpos.history.HistoryFragmentDirections.Companion.actionGlobalMerchantSettings
import net.taler.merchantpos.history.HistoryFragmentDirections.Companion.actionNavHistoryToRefundFragment
@@ -80,7 +81,7 @@ class HistoryFragment : Fragment(), RefundClickListener {
})
historyManager.items.observe(viewLifecycleOwner, { result ->
when (result) {
- is HistoryResult.Error -> requireActivity().showError(result.msg)
+ is HistoryResult.Error -> requireActivity().showError(R.string.error_history, result.msg)
is HistoryResult.Success -> historyListAdapter.setData(result.items)
}.exhaustive
})
diff --git a/merchant-terminal/src/main/res/values/strings.xml b/merchant-terminal/src/main/res/values/strings.xml
index bedc486..bee3cd4 100644
--- a/merchant-terminal/src/main/res/values/strings.xml
+++ b/merchant-terminal/src/main/res/values/strings.xml
@@ -67,6 +67,7 @@
<string name="error_payment">Error: No payment received</string>
<string name="error_timeout">No payment made within payment period, please try again!</string>
<string name="error_cancelled">Payment cancelled</string>
+ <string name="error_history">Error fetching the order history</string>
<string name="toast_back_to_exit">Click «back» again to exit</string>