Merge pull request #2015 from ethereum/yann300-patch-37

Fix tooltip (support object)
pull/1/head
yann300 6 years ago committed by GitHub
commit 00f0125ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      src/app/ui/tooltip.js

@ -25,6 +25,17 @@ class Toaster {
render (tooltipText, action, opts) {
opts = defaultOptions(opts)
if (typeof tooltipText === 'object') {
if (tooltipText.message) {
tooltipText = tooltipText.message
} else {
try {
tooltipText = JSON.stringify(tooltipText)
} catch (e) {
}
}
}
return new Promise((resolve, reject) => {
const shortTooltipText = tooltipText.length > 201 ? tooltipText.substring(0, 200) + '...' : tooltipText

Loading…
Cancel
Save