de-lint Invite.js

This commit is contained in:
David Baker 2017-08-15 13:50:15 +01:00
parent 81273ec855
commit 0df8a63847
2 changed files with 7 additions and 9 deletions

View file

@ -113,7 +113,6 @@ src/components/views/settings/EnableNotificationsButton.js
src/ContentMessages.js src/ContentMessages.js
src/HtmlUtils.js src/HtmlUtils.js
src/ImageUtils.js src/ImageUtils.js
src/Invite.js
src/languageHandler.js src/languageHandler.js
src/linkify-matrix.js src/linkify-matrix.js
src/Login.js src/Login.js

View file

@ -15,7 +15,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import PropTypes from 'prop-types';
import MatrixClientPeg from './MatrixClientPeg'; import MatrixClientPeg from './MatrixClientPeg';
import MultiInviter from './utils/MultiInviter'; import MultiInviter from './utils/MultiInviter';
import Modal from './Modal'; import Modal from './Modal';
@ -41,9 +40,9 @@ export function inviteToRoom(roomId, addr) {
* Simpler interface to utils/MultiInviter but with * Simpler interface to utils/MultiInviter but with
* no option to cancel. * no option to cancel.
* *
* @param {roomId} The ID of the room to invite to * @param {string} roomId The ID of the room to invite to
* @param {array} Array of strings of addresses to invite. May be matrix IDs or 3pids. * @param {string[]} addrs Array of strings of addresses to invite. May be matrix IDs or 3pids.
* @returns Promise * @returns {Promise} Promise
*/ */
export function inviteMultipleToRoom(roomId, addrs) { export function inviteMultipleToRoom(roomId, addrs) {
const inviter = new MultiInviter(roomId); const inviter = new MultiInviter(roomId);
@ -77,7 +76,7 @@ export function showRoomInviteDialog(roomId) {
function _onStartChatFinished(shouldInvite, addrs) { function _onStartChatFinished(shouldInvite, addrs) {
if (!shouldInvite) return; if (!shouldInvite) return;
const addrTexts = addrs.map(addr => addr.address); const addrTexts = addrs.map((addr) => addr.address);
if (_isDmChat(addrTexts)) { if (_isDmChat(addrTexts)) {
// Start a new DM chat // Start a new DM chat
@ -111,7 +110,7 @@ function _onStartChatFinished(shouldInvite, addrs) {
function _onRoomInviteFinished(roomId, shouldInvite, addrs) { function _onRoomInviteFinished(roomId, shouldInvite, addrs) {
if (!shouldInvite) return; if (!shouldInvite) return;
const addrTexts = addrs.map(addr => addr.address); const addrTexts = addrs.map((addr) => addr.address);
// Invite new users to a room // Invite new users to a room
inviteMultipleToRoom(roomId, addrTexts).then((addrs) => { inviteMultipleToRoom(roomId, addrTexts).then((addrs) => {
@ -137,8 +136,8 @@ function _isDmChat(addrTexts) {
function _showAnyInviteErrors(addrs, room) { function _showAnyInviteErrors(addrs, room) {
// Show user any errors // Show user any errors
let errorList = []; const errorList = [];
for (let addr of Object.keys(addrs)) { for (const addr of Object.keys(addrs)) {
if (addrs[addr] === "error") { if (addrs[addr] === "error") {
errorList.push(addr); errorList.push(addr);
} }