From d091550ccb8e7998eb3ebd1d3134cd1c3b4dc71e Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Thu, 6 Jul 2017 15:59:59 +0100 Subject: [PATCH] Use app ID for element key and pass screen parameter to scalar. --- src/ScalarAuthClient.js | 6 ++++-- src/components/views/rooms/AppsDrawer.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ScalarAuthClient.js b/src/ScalarAuthClient.js index e1928e15d4..6908a7f67d 100644 --- a/src/ScalarAuthClient.js +++ b/src/ScalarAuthClient.js @@ -76,10 +76,13 @@ class ScalarAuthClient { return defer.promise; } - getScalarInterfaceUrlForRoom(roomId) { + getScalarInterfaceUrlForRoom(roomId, screen) { var url = SdkConfig.get().integrations_ui_url; url += "?scalar_token=" + encodeURIComponent(this.scalarToken); url += "&room_id=" + encodeURIComponent(roomId); + if (screen) { + url += '&screen=' + encodeURIComponent(screen); + } return url; } @@ -89,4 +92,3 @@ class ScalarAuthClient { } module.exports = ScalarAuthClient; - diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index b535b148ac..a12bd8ecac 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -176,7 +176,7 @@ module.exports = React.createClass({ const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager"); const src = (this.scalarClient !== null && this.scalarClient.hasCredentials()) ? - this.scalarClient.getScalarInterfaceUrlForRoom(this.props.room.roomId) : + this.scalarClient.getScalarInterfaceUrlForRoom(this.props.room.roomId, 'add_integ') : null; Modal.createDialog(IntegrationsManager, { src: src, @@ -187,7 +187,7 @@ module.exports = React.createClass({ const apps = this.state.apps.map( (app, index, arr) => { return