aboutsummaryrefslogtreecommitdiff
path: root/src/webex/pages/popup.tsx
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-10-15 18:30:02 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-10-15 18:30:02 +0200
commit03782f8aea043042aaa069de0b91cdb80fbb4679 (patch)
treecc8890eb060fe15cefa107c9261fc7e558d564b1 /src/webex/pages/popup.tsx
parent23633cf1be5ce8f1bc4d7823d1d561149cb6c8a8 (diff)
downloadwallet-core-03782f8aea043042aaa069de0b91cdb80fbb4679.tar.xz
derive history from db instead of storing it
Diffstat (limited to 'src/webex/pages/popup.tsx')
-rw-r--r--src/webex/pages/popup.tsx23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/webex/pages/popup.tsx b/src/webex/pages/popup.tsx
index 7d12d365e..4e4e9687c 100644
--- a/src/webex/pages/popup.tsx
+++ b/src/webex/pages/popup.tsx
@@ -29,7 +29,6 @@ import * as i18n from "../../i18n";
import {
AmountJson,
Amounts,
- HistoryLevel,
HistoryRecord,
WalletBalance,
WalletBalanceEntry,
@@ -354,8 +353,7 @@ function formatHistoryItem(historyItem: HistoryRecord) {
</i18n.Translate>
);
case "confirm-reserve": {
- // FIXME: eventually remove compat fix
- const exchange = d.exchangeBaseUrl ? (new URI(d.exchangeBaseUrl)).host() : "??";
+ const exchange = (new URI(d.exchangeBaseUrl)).host();
const pub = abbrev(d.reservePub);
return (
<i18n.Translate wrap="p">
@@ -369,7 +367,7 @@ function formatHistoryItem(historyItem: HistoryRecord) {
const link = chrome.extension.getURL("view-contract.html");
return (
<i18n.Translate wrap="p">
- Merchant <em>{abbrev(d.merchantName, 15)}</em> offered contract <a href={link}>{abbrev(d.contractHash)}</a>;
+ Merchant <em>{abbrev(d.merchantName, 15)}</em> offered contract <a href={link}>{abbrev(d.contractTermsHash)}</a>;
</i18n.Translate>
);
}
@@ -395,6 +393,14 @@ function formatHistoryItem(historyItem: HistoryRecord) {
</i18n.Translate>
);
}
+ case "refund": {
+ const merchantElem = <em>{abbrev(d.merchantName, 15)}</em>;
+ return (
+ <i18n.Translate wrap="p">
+ Merchant <span>{merchantElem}</span> gave a refund over <span>{renderAmount(d.refundAmount)}</span>.
+ </i18n.Translate>
+ );
+ }
default:
return (<p>{i18n.str`Unknown event (${historyItem.type})`}</p>);
}
@@ -447,17 +453,8 @@ class WalletHistory extends React.Component<any, any> {
return <span />;
}
- const subjectMemo: {[s: string]: boolean} = {};
const listing: any[] = [];
for (const record of history.reverse()) {
- if (record.subjectId && subjectMemo[record.subjectId]) {
- continue;
- }
- if (record.level !== undefined && record.level < HistoryLevel.User) {
- continue;
- }
- subjectMemo[record.subjectId as string] = true;
-
const item = (
<div className="historyItem">
<div className="historyDate">