diff options
Diffstat (limited to 'src/webex/pages/popup.tsx')
-rw-r--r-- | src/webex/pages/popup.tsx | 23 |
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"> |