+ Wire transport:
+
@@ -680,7 +678,6 @@
this.props.state === 'settings' ?
:
@@ -729,7 +726,8 @@
var EditAccountView = React.createClass({
getInitialState: function() {
return {
- updated: false,
+ updatedDesc: false,
+ updatedPasswd: false,
address: null,
fullName: undefined,
avatar: null,
@@ -760,20 +758,21 @@
},
handleFullNameUpdate: function(fn) {
- this.setState({updated: true, fullName: fn});
+ this.setState({updatedDesc: true, fullName: fn});
},
handlePasswordUpdate: function(pwd) {
- this.setState({updated: true, password: pwd});
+ this.setState({updatedPasswd: true, password: pwd});
},
handleImageChanged: function(img) {
- this.setState({updated: true, avatar: img});
+ this.setState({updatedDesc: true, avatar: img});
},
handleSubmit: function(e) {
e.preventDefault();
- if (this.state.updated) {
- this.props.onSubmit(this.state.password,
- vcard(this.state.fullName, this.state.avatar));
+ if (this.state.updatedDesc || this.state.updatedPasswd) {
+ this.props.onSubmit(
+ this.state.updatedPasswd ? this.state.password : null,
+ this.state.updatedDesc ? vcard(this.state.fullName, this.state.avatar) : null);
}
},
@@ -797,15 +796,15 @@
avatar={this.state.avatar}
onImageChanged={this.handleImageChanged} />
-
-
-
Login: {this.state.login}
Address: {this.state.address}
-
Default access mode:
-
Auth: {this.state.auth}
-
Anon: {this.state.anon}
+
+
Default access mode:
+
+
Auth: {this.state.auth}
+
Anon: {this.state.anon}
+
Update
@@ -1172,6 +1171,7 @@
var InfoView = React.createClass({
getInitialState: function() {
return {
+ owner: false,
updated: false,
address: null,
fullName: undefined,
@@ -1187,7 +1187,9 @@
topic.onMetaDesc = this.onMetaDesc;
var defacs = topic.getDefaultAccess() || {};
+ var acs = topic.getAccessMode();
this.setState({
+ owner: acs && acs.isOwner(),
fullName: topic.public ? topic.public.fn : undefined,
avatar: makeImageUrl(topic.public ? topic.public.photo : null),
private: topic.private,
@@ -1242,6 +1244,7 @@
Name
Private comment
@@ -1254,15 +1257,15 @@
avatar={this.state.avatar}
onImageChanged={this.handleImageChanged} />
-
-
Address: {this.state.address}
{this.state.auth || this.state.anon ?
-
Default access mode:
-
Auth: {this.state.auth}
-
Anon: {this.state.anon}
+
Default access mode:
+
+
Auth: {this.state.auth}
+
Anon: {this.state.anon}
+
:
null
@@ -1526,13 +1529,11 @@
:
null}
- {this.props.displayMobile ?
-
-
-
-
- : null}
+
+
+
+
{this.state.title}
{lastSeen}
@@ -1858,8 +1859,9 @@
handleUpdateAccountRequest: function(password, pub, priv) {
this.handleSidepanelCancel();
- var me = Tinode.getMeTopic();
- me.setMeta({desc: {public: pub, private: priv}});
+ if (pub || priv) {
+ Tinode.getMeTopic().setMeta({desc: {public: pub, private: priv}});
+ }
if (password) {
Tinode.updateAccountBasic(null, Tinode.getCurrentLogin(), password);
}
@@ -2066,7 +2068,8 @@