From 9c8ab2691b1cdc3f3c061bd1b049b208f590fd2b Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Wed, 14 Jun 2017 13:26:43 +0200 Subject: [PATCH] AppsDrawer: Only append queryParams once --- src/components/views/rooms/AppsDrawer.js | 29 ++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index 1d738fb9d2..a917dde5f6 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -50,13 +50,12 @@ module.exports = React.createClass({ switch(app.type) { case 'etherpad': - app.url = app.url + '?userName=' + this.props.userId + + app.queryParams = '?userName=' + this.props.userId + '&padId=' + this.props.room.roomId; break; case 'jitsi': { const user = MatrixClientPeg.get().getUser(this.props.userId); - app.url = app.url + - '?confId=' + app.data.confId + + app.queryParams = '?confId=' + app.data.confId + '&displayName=' + encodeURIComponent(user.displayName) + '&avatarUrl=' + encodeURIComponent(MatrixClientPeg.get().mxcUrlToHttp(user.avatarUrl)) + '&email=' + encodeURIComponent(this.props.userId) + @@ -181,15 +180,21 @@ module.exports = React.createClass({ render: function() { const apps = this.state.apps.map( - (app, index, arr) => ); + (app, index, arr) => { + let appUrl = app.url; + if (app.queryParams) { + appUrl += app.queryParams; + } + return ; + }); const addWidget = this.state.apps && this.state.apps.length < 2 && (