and nother place where title length is enforced

This commit is contained in:
or-else
2019-11-06 11:27:49 +03:00
parent 8c1b926008
commit 6a2efac566
+4 -1
View File
@@ -10,7 +10,7 @@ import InPlaceEdit from '../widgets/in-place-edit.jsx';
import PermissionsEditor from '../widgets/permissions-editor.jsx'; import PermissionsEditor from '../widgets/permissions-editor.jsx';
import TagManager from '../widgets/tag-manager.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 { makeImageUrl } from '../lib/blob-helpers.js';
import { arrayEqual, asEmail, asPhone, vcard } from '../lib/utils.js'; import { arrayEqual, asEmail, asPhone, vcard } from '../lib/utils.js';
@@ -70,9 +70,12 @@ export default class EditAccountView extends React.Component {
} }
handleFullNameUpdate(fn) { handleFullNameUpdate(fn) {
fn = fn.trim().substring(0, MAX_TITLE_LENGTH);
if (fn) {
this.setState({fullName: fn}); this.setState({fullName: fn});
this.props.onUpdateAccount(undefined, vcard(fn, null)); this.props.onUpdateAccount(undefined, vcard(fn, null));
} }
}
handlePasswordUpdate(pwd) { handlePasswordUpdate(pwd) {
this.setState({password: pwd}); this.setState({password: pwd});