Support multiple integration managers behind a labs flag
Fixes https://github.com/vector-im/riot-web/issues/10622 Implements [MSC1957](https://github.com/matrix-org/matrix-doc/pull/1957) Design is not final.
This commit is contained in:
parent
602c338a26
commit
b3cda4b19a
13 changed files with 318 additions and 21 deletions
|
@ -548,8 +548,8 @@ const onMessage = function(event) {
|
|||
// (See https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)
|
||||
let configUrl;
|
||||
try {
|
||||
// TODO: Support multiple integration managers
|
||||
configUrl = new URL(IntegrationManagers.sharedInstance().getPrimaryManager().uiUrl);
|
||||
if (!openManagerUrl) openManagerUrl = IntegrationManagers.sharedInstance().getPrimaryManager().uiUrl;
|
||||
configUrl = new URL(openManagerUrl);
|
||||
} catch (e) {
|
||||
// No integrations UI URL, ignore silently.
|
||||
return;
|
||||
|
@ -657,6 +657,7 @@ const onMessage = function(event) {
|
|||
};
|
||||
|
||||
let listenerCount = 0;
|
||||
let openManagerUrl = null;
|
||||
module.exports = {
|
||||
startListening: function() {
|
||||
if (listenerCount === 0) {
|
||||
|
@ -679,4 +680,8 @@ module.exports = {
|
|||
console.error(e);
|
||||
}
|
||||
},
|
||||
|
||||
setOpenManagerUrl: function(url) {
|
||||
openManagerUrl = url;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue