bug fixes: crash in editing group member permissions, fnd not working sometimes, var -> let, const

This commit is contained in:
or-else
2018-12-13 15:42:54 +03:00
parent 10d88da558
commit bc3e82bcbf
12 changed files with 49 additions and 85 deletions
+5 -5
View File
@@ -27,11 +27,11 @@ class ContactList extends React.Component {
const contactNodes = [];
if (this.props.contacts && this.props.contacts.length > 0) {
this.props.contacts.map((c) => {
var key = c.topic ? c.topic : c.user;
let key = c.topic ? c.topic : c.user;
// If filter function is provided, filter out the items
// which don't satisfy the condition.
if (this.props.filterFunc && this.props.filter) {
var content = [key];
let content = [key];
if (c.private && c.private.comment) {
content.push(('' + c.private.comment).toLowerCase());
}
@@ -43,10 +43,10 @@ class ContactList extends React.Component {
}
}
var selected = showCheckmark ?
let selected = showCheckmark ?
(this.props.topicSelected.indexOf(key) > -1) :
(this.props.topicSelected === key);
var badges = [];
let badges = [];
if (this.props.showMode) {
if (key === this.props.myUserId) {
badges.push({name: formatMessage(messages.badge_you), color: 'green'});
@@ -55,7 +55,7 @@ class ContactList extends React.Component {
badges.push({name: formatMessage(messages.badge_owner), color: 'blue'});
}
}
var comment = Array.isArray(c.private) ?
let comment = Array.isArray(c.private) ?
c.private.join(',') : (c.private ? c.private.comment : null);
contactNodes.push(
+3 -3
View File
@@ -36,9 +36,9 @@ export default class Contact extends React.Component {
// FIXME: this is probably wrong for RTL languages.
title = title.substring(0, 28) + '...';
}
let online = this.props.now ? 'online' : 'offline';
let avatar = this.props.avatar ? this.props.avatar : true;
let badges = this.props.badges.slice();
const online = this.props.now ? 'online' : 'offline';
const avatar = this.props.avatar ? this.props.avatar : true;
const badges = this.props.badges ? this.props.badges.slice() : [];
if (this.props.showMode && this.props.acs) {
badges.push({name: this.props.acs.getMode(), key: 'mode'});
}
+2 -12
View File
@@ -8,21 +8,11 @@ import { makeImageUrl } from '../lib/blob-helpers.js';
export default class GroupSubs extends React.Component {
constructor(props) {
super(props);
this.state = {
onlineSubs: props.subscribers || []
};
}
static getDerivedStateFromProps(nextProps, prevState) {
return {
onlineSubs: nextProps.subscribers ? nextProps.subscribers : []
};
}
render() {
var usersOnline = [];
this.state.onlineSubs.map((sub) => {
const usersOnline = [];
(this.props.subscribers || []).map((sub) => {
usersOnline.push(
<div className="avatar-box" key={sub.user}>
<LetterTile