Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d7f5295

Browse files
committed
untested WIP for supporting multiple widgets properly
1 parent bb08459 commit d7f5295

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/ScalarAuthClient.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ class ScalarAuthClient {
7676
return defer.promise;
7777
}
7878

79-
getScalarInterfaceUrlForRoom(roomId, screen) {
79+
getScalarInterfaceUrlForRoom(roomId, screen, id) {
8080
var url = SdkConfig.get().integrations_ui_url;
8181
url += "?scalar_token=" + encodeURIComponent(this.scalarToken);
8282
url += "&room_id=" + encodeURIComponent(roomId);
83+
if (id) {
84+
url += '&integ_id=' + id;
85+
}
8386
if (screen) {
8487
url += '&screen=' + encodeURIComponent(screen);
8588
}

src/components/views/elements/AppTile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default React.createClass({
122122
_onEditClick: function(e) {
123123
console.log("Edit widget ID ", this.props.id);
124124
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
125-
const src = this._scalarClient.getScalarInterfaceUrlForRoom(this.props.room.roomId, 'type_' + this.props.type);
125+
const src = this._scalarClient.getScalarInterfaceUrlForRoom(this.props.room.roomId, 'type_' + this.props.type, this.props.id);
126126
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
127127
src: src,
128128
}, "mx_IntegrationsManager");

src/components/views/rooms/AuxPanel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,18 @@ module.exports = React.createClass({
129129
);
130130

131131
let appsDrawer = null;
132+
let appCount = 0;
132133
if(UserSettingsStore.isFeatureEnabled('matrix_apps') && this.props.showApps) {
134+
const appsStateEvents = this.props.room.currentState.getStateEvents('im.vector.modular.widgets');
135+
if (appsStateEvents) appCount = appsStateEvents.length;
133136
appsDrawer = <AppsDrawer ref="appsDrawer"
134137
room={this.props.room}
135138
userId={this.props.userId}
136139
maxHeight={this.props.maxHeight}/>;
137140
}
138141

139142
return (
140-
<div className={ appsDrawer ? "mx_RoomView_auxPanel mx_RoomView_auxPanel_apps" : "mx_RoomView_auxPanel" } style={{maxHeight: this.props.maxHeight}} >
143+
<div className={ appCount == 2 ? "mx_RoomView_auxPanel mx_RoomView_auxPanel_wide" : "mx_RoomView_auxPanel" } style={{maxHeight: this.props.maxHeight}} >
141144
{ appsDrawer }
142145
{ fileDropTarget }
143146
{ callView }

0 commit comments

Comments
 (0)