From 6a2efac5667516549fa688ca747b1fc5320a2bdb Mon Sep 17 00:00:00 2001 From: or-else Date: Wed, 6 Nov 2019 11:27:49 +0300 Subject: [PATCH] and nother place where title length is enforced --- src/views/edit-account-view.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/edit-account-view.jsx b/src/views/edit-account-view.jsx index 400ef3bb..339f234d 100644 --- a/src/views/edit-account-view.jsx +++ b/src/views/edit-account-view.jsx @@ -10,7 +10,7 @@ import InPlaceEdit from '../widgets/in-place-edit.jsx'; import PermissionsEditor from '../widgets/permissions-editor.jsx'; import TagManager from '../widgets/tag-manager.jsx'; -import { LINK_CONTACT_US, LINK_PRIVACY_POLICY, LINK_TERMS_OF_SERVICE } from '../config.js'; +import { LINK_CONTACT_US, LINK_PRIVACY_POLICY, LINK_TERMS_OF_SERVICE, MAX_TITLE_LENGTH } from '../config.js'; import { makeImageUrl } from '../lib/blob-helpers.js'; import { arrayEqual, asEmail, asPhone, vcard } from '../lib/utils.js'; @@ -70,8 +70,11 @@ export default class EditAccountView extends React.Component { } handleFullNameUpdate(fn) { - this.setState({fullName: fn}); - this.props.onUpdateAccount(undefined, vcard(fn, null)); + fn = fn.trim().substring(0, MAX_TITLE_LENGTH); + if (fn) { + this.setState({fullName: fn}); + this.props.onUpdateAccount(undefined, vcard(fn, null)); + } } handlePasswordUpdate(pwd) {