1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #344 from Zanibas/character-limit

Character limit implemented for wallet names
This commit is contained in:
kumavis 2016-06-28 13:02:34 -07:00 committed by GitHub
commit 2fd03a60fb
2 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,8 @@
- Fixed bug where MetaMask interfered with PDF loading. - Fixed bug where MetaMask interfered with PDF loading.
- Moved switch account icon into menu bar. - Moved switch account icon into menu bar.
- Changed status shapes to be a yellow warning sign for failure and ellipsis for pending transactions. - Changed status shapes to be a yellow warning sign for failure and ellipsis for pending transactions.
- Now enforce 30 character limit on wallet names.
## 2.4.4 2016-06-23 ## 2.4.4 2016-06-23

View File

@ -18,6 +18,7 @@ EditableLabel.prototype.render = function () {
return h('div.editable-label', [ return h('div.editable-label', [
h('input.sizing-input', { h('input.sizing-input', {
defaultValue: props.textValue, defaultValue: props.textValue,
maxLength: '30',
onKeyPress: (event) => { onKeyPress: (event) => {
this.saveIfEnter(event) this.saveIfEnter(event)
}, },
@ -44,6 +45,7 @@ EditableLabel.prototype.saveIfEnter = function (event) {
EditableLabel.prototype.saveText = function () { EditableLabel.prototype.saveText = function () {
var container = findDOMNode(this) var container = findDOMNode(this)
var text = container.querySelector('.editable-label input').value var text = container.querySelector('.editable-label input').value
this.props.saveText(text) var truncatedText = text.substring(0, 30)
this.setState({ isEditingLabel: false, textLabel: text }) this.props.saveText(truncatedText)
this.setState({ isEditingLabel: false, textLabel: truncatedText })
} }