From 2cf33705c8ef95e04144b2a77cd4a79189136199 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 4 Jun 2017 20:16:09 +0200 Subject: warn about incompatible versions on withdraw --- src/webex/pages/confirm-create-reserve.tsx | 34 +++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/webex/pages/confirm-create-reserve.tsx') diff --git a/src/webex/pages/confirm-create-reserve.tsx b/src/webex/pages/confirm-create-reserve.tsx index ca8517a25..f8f53510c 100644 --- a/src/webex/pages/confirm-create-reserve.tsx +++ b/src/webex/pages/confirm-create-reserve.tsx @@ -414,10 +414,41 @@ class ExchangeSelection extends ImplicitStateComponent { ); } + renderUpdateStatus() { + const rci = this.reserveCreationInfo(); + if (!rci) { + return null; + } + if (!rci.versionMatch) { + return null; + } + if (rci.versionMatch.compatible) { + return null; + } + if (rci.versionMatch.currentCmp == -1) { + return ( +

+ Your wallet might be outdated. The exchange has a higher, incompatible + protocol version. +

+ ); + } + if (rci.versionMatch.currentCmp == 1) { + return ( +

+ The chosen exchange might be outdated. The exchange has a lower, incompatible + protocol version. +

+ ); + } + throw Error("not reached"); + } + renderConfirm() { return (
{this.renderFeeStatus()} +

-
+

+ {this.renderUpdateStatus()} {renderReserveCreationDetails(this.reserveCreationInfo())} -- cgit v1.2.3