From 03f39c2d2be43086cd483248d05f05cd5521edb6 Mon Sep 17 00:00:00 2001 From: pawellula Date: Sun, 31 Jan 2021 19:28:36 +0100 Subject: [PATCH] Do not shorten hex data when it's exactly the same length --- apps/remix-ide/src/lib/helper.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/lib/helper.js b/apps/remix-ide/src/lib/helper.js index cb0a421fca..87bc041bed 100644 --- a/apps/remix-ide/src/lib/helper.js +++ b/apps/remix-ide/src/lib/helper.js @@ -18,9 +18,10 @@ export default { }, shortenHexData: function (data) { if (!data) return '' - if (data.length < 5) return data + var sliceLen = 5 var len = data.length - return data.slice(0, 5) + '...' + data.slice(len - 5, len) + if (len < sliceLen * 2) return data + return data.slice(0, sliceLen) + '...' + data.slice(len - sliceLen, len) }, createNonClashingNameWithPrefix (name, fileProvider, prefix, cb) { if (!name) name = 'Undefined'