diff --git a/src/ScalarAuthClient.js b/src/ScalarAuthClient.js index 819fe3c998..1253023c53 100644 --- a/src/ScalarAuthClient.js +++ b/src/ScalarAuthClient.js @@ -27,6 +27,8 @@ import SdkConfig from "./SdkConfig"; // The version of the integration manager API we're intending to work with const imApiVersion = "1.1"; +// TODO: Generify the name of this class and all components within - it's not just for Scalar. + export default class ScalarAuthClient { constructor(apiUrl, uiUrl) { this.apiUrl = apiUrl; diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 607f702c73..9731e42825 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -16,6 +16,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// TODO: Generify the name of this and all components within - it's not just for scalar. + /* Listens for incoming postMessage requests from the integrations UI URL. The following API is exposed: { diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 58bfda8d22..86da0fbb58 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -188,13 +188,14 @@ export default class AppTile extends React.Component { } } + // TODO: Generify the name of this function. It's not just scalar tokens. /** * Adds a scalar token to the widget URL, if required * Component initialisation is only complete when this function has resolved */ setScalarToken() { if (!WidgetUtils.isScalarUrl(this.props.app.url)) { - console.warn('Non-scalar widget, not setting scalar token!', url); + console.warn('Widget does not match integration manager, refusing to set auth token', url); this.setState({ error: null, widgetUrl: this._addWurlParams(this.props.app.url), @@ -218,7 +219,7 @@ export default class AppTile extends React.Component { const defaultManager = managers.getPrimaryManager(); if (!WidgetUtils.isScalarUrl(defaultManager.apiUrl)) { - console.warn('Non-scalar manager, not setting scalar token!', url); + console.warn('Unknown integration manager, refusing to set auth token', url); this.setState({ error: null, widgetUrl: this._addWurlParams(this.props.app.url), diff --git a/src/utils/WidgetUtils.js b/src/utils/WidgetUtils.js index 6a0556c2b3..62113b652b 100644 --- a/src/utils/WidgetUtils.js +++ b/src/utils/WidgetUtils.js @@ -72,6 +72,7 @@ export default class WidgetUtils { return room.currentState.maySendStateEvent('im.vector.modular.widgets', me); } + // TODO: Generify the name of this function. It's not just scalar. /** * Returns true if specified url is a scalar URL, typically https://scalar.vector.im/api * @param {[type]} testUrlString URL to check